I am using bullet on the iPhone.
I coded a lift object which needs to just go up and down.
It works but it is very CPU hungry, resulting in a very low framerate. My code is below. I tracked down the performance issue to be with the setAngularLimit functions. Is there any way to replace these given i want something so simple as a lift?
Code: Select all
btGeneric6DofConstraint* slider;
btTransform frameInA = btTransform::getIdentity();
frameInA.setOrigin(btVector3(btScalar(0), btScalar(0), btScalar(6.125)));
btTransform frameInB = btTransform::getIdentity();
frameInB.setOrigin(btVector3(btScalar(0), btScalar(0), btScalar(0)));
slider = new btGeneric6DofConstraint( *cylinder2->_SIO2objectphysic->_btRigidBody, *cylinder3->_SIO2objectphysic->_btRigidBody,
frameInA, frameInB, true );
slider->setLinearLowerLimit(btVector3(0,0,0));
slider->setLinearUpperLimit(btVector3(0,0,100));
slider->setAngularLowerLimit(btVector3(0,0,0));
slider->setAngularUpperLimit(btVector3(0,0,0));
_MWlevel->_SIO2physic->_btSoftRigidDynamicsWorld->addConstraint(slider, true);david