Bug of btSliderConstraint ???
Posted: Wed Jan 20, 2010 2:56 am
Hi , everyone, I am using bullet, and find a strange phenomena. I set btSliderConstraint between a btCompoundShape and a small btCylinderShapeX. The btCylinderShapeX is expected to move up and down(Y axes) or back and forth(Z axes) in the Constrain, but it only moves right and left(X axes). so how can I realize it ? Or is it a bug in btSliderConstraint?
my code:
......
btCollisionShape* smallwheel0 = new btCylinderShapeX(btVector3(2,4,4));
btTransform smalltrans;
smalltrans.setIdentity();
smalltrans.setOrigin(btVector3(0,2,0));
btRigidbody* m_smallbody = localCreateRigidBody(20,smalltrans,smallwheel0);
btTransform bodyA,small0B;
bodyA.setIdentity();
small0B.setIdentity();
bodyA.setOrigin(btVector3(0,16,0));
small0B.setOrigin(btVector3(0,2,0));
btSliderConstraint* slider = new btSliderConstraint(*m_body,*m_smallbody,bodyA,small0B,true);
/***m_body is a btCompoundShape including two btCylinderShapeXs with 12 radius****/
getDynamicsWorld()->addConstraint(slider,true);
Your suggestion will be greatly appreciated.
Thank you, Thank you very much!
Jet
my code:
......
btCollisionShape* smallwheel0 = new btCylinderShapeX(btVector3(2,4,4));
btTransform smalltrans;
smalltrans.setIdentity();
smalltrans.setOrigin(btVector3(0,2,0));
btRigidbody* m_smallbody = localCreateRigidBody(20,smalltrans,smallwheel0);
btTransform bodyA,small0B;
bodyA.setIdentity();
small0B.setIdentity();
bodyA.setOrigin(btVector3(0,16,0));
small0B.setOrigin(btVector3(0,2,0));
btSliderConstraint* slider = new btSliderConstraint(*m_body,*m_smallbody,bodyA,small0B,true);
/***m_body is a btCompoundShape including two btCylinderShapeXs with 12 radius****/
getDynamicsWorld()->addConstraint(slider,true);
Your suggestion will be greatly appreciated.
Thank you, Thank you very much!
Jet