Bullet3D Sample Code to OgreBullet framework

sujith2s

30-03-2010 21:25:48

Hi all,

I have managed to compile ogrebullet framework with Ogre1.7 and Bullet 2.76.
Previously I have tried slider constraint and hinge constraint in Bullet3D. Now i found DIfficulties in following areas

1) i didn't found any wrapper for SliderConstraint

2)My trial in Bullet 3D simulation using defaultMotionstate. I don't know how it will be useful if i am going to use a motionstate class derived from btMotionState. In bullet3d i used to constraint two rigid bodies using slider or hinge, then set the upper and lower limit. After that enableAngularMotor fuction to rotate the hinge in the clientMoveAndDisplay() function in small steps of angle. And that was Ok to some extent.

3) If i am using MotionState, is it possible to use kinematic rigidbody with slider or hinge constraint. Also if we are using kinematic rigidbody with slider constraint does motionstate handles the movement of the rigidbody in a particular velocity until we interrupt or the upper /lower limit reached.

If anybody have any idea, please help.

Thanks,
Sujith

sujith2s

06-04-2010 19:59:42

Hi,

What i found from my trials is,

1, We can derive motionstate for each rigidbody in the scene.
2. For dynamic rigidbody the motionstate setTransform function will be called by the stepsimulation.
3. For kinematic rigidbody the the getTransform function will be called by the stepsimulation. So we need to set the transform according to our need.
4. I found that kinematic rigidbody will be usefull for games in which the moving object has some animations.
5. If we use kinematic rigidbody if we set a tranform of 10 in one direction then the intermediate steps will not be displayed. only the begining and end motion will be displayed. So there is a chance for jurking.

Can anyone please tell me what i found is right. Can anyone have any idea if i am going to simulate a machine, which type of rigidbody will be useful. If we use a dynamic rigidbody with constraint solvers, is it going to be unstable??

Please Help. :)

Fish

06-04-2010 20:28:21

I'm not sure if this helps you but you can manually set the transform per frame using mBody->getBulletRigidBody()->setWorldTransform(xForm). You may have to do this before the call to stepsimulation in order for the node to be updated by the motionstate.

-Fish