Easy Beginner Question

lath
Posts: 4
Joined: Fri Mar 06, 2009 5:08 am

Easy Beginner Question

Post by lath »

Hello,

I'm a beginner with bullet physics (and physics in general). So far I have followed the hello world tutorial successfully. I was able to translate that into an OpenGL 3D scene as well to render the ball dropping onto the plane.

Now I would like to be able to rotate the plane and cause the ball to roll around realistically. Is there a demo out there for this?

I don't really know what I'm doing so I'm just stabbing in the dark trying code that isn't working. So far I've tried to use the following code to make the plane kinematic:

groundRigidBody->setCollisionFlags( groundRigidBody->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT);
groundRigidBody->setActivationState(DISABLE_DEACTIVATION);

and then apply yaw/pitch/roll to the ground plane with this:

groundRigidBody->proceedToTransform(btTransform(btQuaternion(yaw, pitch, roll)));

but that didn't work. So I tried converting the groundRigidBody to a btBoxShape and that didn't help either.

Any help would be greatly appreciated.

Thanks,

Lath
mickey
Posts: 107
Joined: Fri Sep 19, 2008 6:08 pm

Re: Easy Beginner Question

Post by mickey »

Hmm.. I never used proceedToTransform to transform a rigid body. Would you try setWorldTransform instead? That should work.