translating a btRigidBody

haba
Posts: 21
Joined: Sun Oct 12, 2008 3:38 pm

translating a btRigidBody

Post by haba »

Hi,

I'm simply trying to apply a translation to a rigid body in my scene. I thought body.setOrigin(btVector3(x,y,z)) would be enough, however it seems to work only before the call to the btDefaultMotionState constructor. Is there any way to update the motion state with the new transform? Or am I doing this all wrong?

Thanks!
haba
Posts: 21
Joined: Sun Oct 12, 2008 3:38 pm

Re: translating a btRigidBody

Post by haba »

Hmm... been thinking and translating my object is probably not what I want to do...
I'll explain: the object I want to translate is my avatar controlled by the keyboard. So, I press W and the avatar moves forward.
I guess applying a force on my avatar would be more correct? Any suggestions?

Thanks!
ihar3d
Posts: 25
Joined: Wed Jan 23, 2008 11:28 am

Re: translating a btRigidBody

Post by ihar3d »

See Character Controller in Character Demo. It should help you.
mickey
Posts: 107
Joined: Fri Sep 19, 2008 6:08 pm

Re: translating a btRigidBody

Post by mickey »

are you trying to move a rigid body manually or a kinematic object (eg, the character demo mentioned).

In either way you can find both examples at the character demo that comes with Bullet.