Code: Select all
const btVector3 pivot( 0.0f, 0.0f, -radius );
btVector3 axis( 1.0f, 0.0f, 0.0f );
btHingeConstraint *_btHingeConstraint = new btHingeConstraint( *_btRigidBody, pivot, axis );
_btSoftRigidDynamicsWorld->addConstraint( _btHingeConstraint, true );
The problem comes when I try to put the constraint on the X and Y axis at the same time... to do so I modify the following code:
btVector3 axis( 1.0f, 1.0f, 0.0f );
and use:
_btRigidBody->setAngularVelocity( btVector3( -180.0f, -180.0f, 0.0f ) ); in order to test, but my rigid body is like going offscreen and disappear...
I also try to create 2 separate constraint 1 on X and 1 on Y, and use 2 separate setAngularVelocity call but no success...
What Im am doing wrong? Is there a way to put 2 constraint on different axis on a rigid body? What Im trying to do is like a punching bag ( a cylinder attached to a certain point in space ) that when I click it "angles" on the X and Y axis simultaneously... Help!
Tks in advance,
Cheers,