Ask how to disable Y Axis movement in bullet physics

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
azer89
Gnoblar
Posts: 22
Joined: Sat Aug 09, 2008 4:12 am

Ask how to disable Y Axis movement in bullet physics

Post by azer89 »

Hi i wanna ask about bullet physics, i want to create an object than only moves around X and Z axis, and Y axis is disabled (it's like movement in 2D, and the object wont fall down) I use 6 dof constraint to restrict y axis movement, but right now it doesn't work

Code: Select all

btRigidBody* zeroBody = new btRigidBody(0, NULL, NULL); // Create the body that we attach things to
btRigidBody* robot = mCarChassis->getBulletRigidBody();

btGeneric6DofConstraint* constrict = new btGeneric6DofConstraint(*robot, *zeroBody, btTransform::getIdentity(), btTransform::getIdentity(), false);

constrict->setLinearLowerLimit( btVector3( 1, 1, 1));
constrict->setLinearUpperLimit( btVector3(-1, 1,-1));

constrict->setAngularLowerLimit( btVector3( 1,  1,  1) );
constrict->setAngularUpperLimit( btVector3(-1, -1, -1) );

mBulletWorld->getBulletDynamicsWorld()->addConstraint(constrict);
thanks!
User avatar
omniter
OGRE Contributor
OGRE Contributor
Posts: 424
Joined: Thu Mar 19, 2009 8:08 am
Location: Canada
x 44

Re: Ask how to disable Y Axis movement in bullet physics

Post by omniter »

This question doesn't belong in the OGRE forums. :)
Post Reply