sxk8087
27-08-2008 04:57:05
I use "Body->setVelocity()" to control characters moving forward.
"Body->setOmega()" to Rotate. But making characters move forward for a period of time. The characters will not move no matter what I do
(Such as press Key'W','S','A','D'). my code is :
if (keyboard->isKeyDown(KC_W))
{
mDirection = mMainNode->getOrientation() * ctor3::UNIT_X;
mDirection.y = 0;
Body->setVelocity(mDirection);
}
if (keyboard->isKeyDown(KC_A))
{
mDirection = mMainNode->getOrientation()*Vector3::UNIT_X;
mDirection.y = 0;
Body->setVelocity(mDirection);
Body->setOmega(Vector3(0,1,0));
}
I can control it at the beginning,but after it I can not control until the last. Other,I want to know how you control characters.
I am sorry that my English is poor.I hope you understand my meaning
"Body->setOmega()" to Rotate. But making characters move forward for a period of time. The characters will not move no matter what I do
(Such as press Key'W','S','A','D'). my code is :
if (keyboard->isKeyDown(KC_W))
{
mDirection = mMainNode->getOrientation() * ctor3::UNIT_X;
mDirection.y = 0;
Body->setVelocity(mDirection);
}
if (keyboard->isKeyDown(KC_A))
{
mDirection = mMainNode->getOrientation()*Vector3::UNIT_X;
mDirection.y = 0;
Body->setVelocity(mDirection);
Body->setOmega(Vector3(0,1,0));
}
I can control it at the beginning,but after it I can not control until the last. Other,I want to know how you control characters.
I am sorry that my English is poor.I hope you understand my meaning