Hello,
Looks like something is wrong with the initial hinge setup.
To understand what happens I need to know where the bodies are placed,
how they are oriented. Hinge counstructor uses these parameters to build constraint frames.
Could you please post your setup code, like:
Code: Select all
btTransform tr;
tr.setIdentity();
tr.setOrigin(btVector3(btScalar(-20.), btScalar(-2.), btScalar(0.)));
btRigidBody* pBodyA = localCreateRigidBody( 1.0f, tr, shape);
pBodyA->setActivationState(DISABLE_DEACTIVATION);
// dynamic bodyB:
tr.setIdentity();
tr.setOrigin(btVector3(btScalar(-30.), btScalar(-2.), btScalar(0.)));
btRigidBody* pBodyB = localCreateRigidBody(1.0, tr, shape);
pBodyB->setActivationState(DISABLE_DEACTIVATION);
// add some data to build constraint frames
btVector3 axisA(0.f, 1.f, 0.f);
btVector3 axisB(0.f, 1.f, 0.f);
btVector3 pivotA(-5.f, 0.f, 0.f);
btVector3 pivotB( 5.f, 0.f, 0.f);
spHingeDynAB = new btHingeConstraint(*pBodyA, *pBodyB, pivotA, pivotB, axisA, axisB);
spHingeDynAB->setLimit(-SIMD_HALF_PI * 0.5f, SIMD_HALF_PI * 0.5f);
// add constraint to world
m_dynamicsWorld->addConstraint(spHingeDynAB, true);
This will help me to find a problem
About other constraint parameters:
softness is not used by current version of solver;
biasFactor works as a multiplier to constraint error, constraint becomes more "soft" when this factor is close to zero;
relaxation used to control bounce on limits : 1.0 means full bounce, 0.0 means no bounce
Thanks,
Roman