2014/07/10

kinematic object in Bullet

There seems to be kinematic object in Bullet. It is one of the rigid body and you can control its position and angular, so I tried to use this kinematic object as a moving box in a coin pusher game. The box moves back and forth repeatedly.

But this kinematic object does not move as I expected.
Most of the page explaining the kinematic object says there are two important points. One is to set a flag by setCollisionFlags. Second, call getWorldTransform like :
rigidBody->setWorldTransform(transform);
I was about to give up to use this, but I found one page and the code was like this :
rigidBody->getMotionState()->setWorldTransform(transform);
And this did actually work!
Develop | Comments(1) | Trackback(0)
Comment
Comment is pending approval.
Comment is pending blog author's approval.

管理者のみに表示