Problem to Rotating Force to Orientation Object

aleradish
Posts: 22
Joined: Thu Mar 05, 2009 9:41 pm

Problem to Rotating Force to Orientation Object

Post by aleradish »

Hi to All, and sorry for my very poor english:)...

I have this Problem. I want to move my body in the verse of the Orientation (Always) and in indipendent mode from the camera. For make that I've wrote,

btQuaternion OrientQ=this->cameraBody->getOrientation();

To my body, with directional Arrows, I apply

this->cameraBody->applyTorqueImpulse(opportune btVector3);

now I want to update my central direction for make that if I press Up arrow, my Body follow always the same direction.

my btVector is

btVector3 ActualDirection = btVector3(0,1,0);
now,
when I apply the Torque, i want to rotate this vector.

for make that I tried the seguent but without success

btquaternion Q = this->cameraBody->getOrientation();
this->ActualDirection=this->ActualDirection.Rotate(btVector3(0,1,0),Q.getYaw()/getY());

I tried to convert Yaw with the getYaw.valueRadiant, value degree...angle unit but without Success. Where i Made Wrong?

Thanks for Help.
mickey
Posts: 107
Joined: Fri Sep 19, 2008 6:08 pm

Re: Problem to Rotating Force to Orientation Object

Post by mickey »

would the kinematic character controller demo that comes with the sdk help?

Do you meant to say that you want your rigid body to move in the direction its currently looking at if you hit the up arrow but right now you couldn't get it to work?

If so the sample might help.
aleradish
Posts: 22
Joined: Thu Mar 05, 2009 9:41 pm

Re: Problem to Rotating Force to Orientation Object

Post by aleradish »

Yes... it will be but I didn't have understood so much. and not seems exactly what I have to do...

I need to applyTorque to an Object (controlled by an User) and get the vector in front of this object for mantaining correct direction of navigation of my Object.

But simple i would do getOrientation() from my Object and after, "putting it" into a Vector that maintain the front direction of my body (I will apply that as a force).

the example that u have told to me... didn't see what I have to do.

Thank you for your response.. If u can explain me how I can make anything similar.. or any workaround... You make me a very pleasure:)

Thanks so much..