Step from a transformation to an other

OSasuke
Posts: 47
Joined: Tue Dec 09, 2008 10:12 am

Step from a transformation to an other

Post by OSasuke »

Hello.

Let's say : I have a rigid body with the btTransfrom tA.

Code: Select all

btRigidBody* body;
btTransform tA = body->getCenterOfMassTransform();
And I have a second transform tB;

Code: Select all

btTransform tB;
tB.setOrigin(btVector3(x,y,z));
tB.setRotation(btQuaternion(x,y,z,w));
Now, i want to know what are the linearImpluse and the torqueImpluse i have to apply to the body to step from tA to tB one step;

Code: Select all

body->applyCentralImpluse(btVector(?,?,?));
body->applyTorqueImpluse(btVector(?,?,?));
I tried this :

Code: Select all

btVector3 linear, angular;
btTransformUtil::calculateVelocity(tA, tB, 1, linear, angular);
body->applyCentralImpluse(linear);
body->applyTorqueImpluse(angular);
But it seem to not work.

Can anyone help me please ?
Thanks.
OSasuke
Posts: 47
Joined: Tue Dec 09, 2008 10:12 am

Re: Step from a transformation to an other

Post by OSasuke »

Up
lulzfish
Posts: 43
Joined: Mon Jan 03, 2011 4:26 pm

Re: Step from a transformation to an other

Post by lulzfish »

Maybe you want to set the velocity, instead of applying an impulse?
should be something like setVelocity and setAngularVelocity.