Rotating rigibody

Post Reply
saneeshnair
Posts: 11
Joined: Thu Apr 07, 2011 5:59 am

Rotating rigibody

Post by saneeshnair »

I have a cube and an inclined plane. I applied force to the cube and translated it to the top of inclined plane. Now I need to rotate this cube.


Code: Select all

m_turnAngle -= 0.017453293;
btTransform xform;
xform.setRotation (btQuaternion (btVector3(0.0, 0.0, 1.0), m_turnAngle));
m_cube->getMotionState()->setWorldTransform (xform);
m_cube->setCenterOfMassTransform (xform);	
But this code will make the cube collide with slope.

What should I do?

Many Thanks,
Saneesh
Post Reply