I am following the Hinge2Vehicle example to create a vehicle.
When I drop my vehicle on the ground, it oscilates indefinitely.
I create my hinge as follows:
Code: Select all
btVector3 anchor = wp;
anchor[1] += (i&2) ? WHEELPIVOTOFFSET : -WHEELPIVOTOFFSET;
btVector3 axis1( 0,0,1 );
btVector3 axis2( 0,1,0 );
btHinge2Constraint* hinge = new btHinge2Constraint( *cb, *wb, anchor, axis1, axis2 );
obdb_joints[j] = hinge;
hinge->setParam( BT_CONSTRAINT_CFM, 0.20f, 1 );
hinge->setParam( BT_CONSTRAINT_ERP, 0.25f, 1 );
hinge->enableMotor( 3, true );
hinge->setMaxMotorForce( 3, 500.0);
hinge->setTargetVelocity( 3, -1 );
hinge->enableMotor( 5, true );
hinge->setMaxMotorForce( 5, 500.0);
hinge->setTargetVelocity( 5, 0 );
obdb_world->addConstraint( hinge );
How can I damp the suspension of Hinge2?
ODE uses CFM and ERP for this, so I tried setting those parameters, to no avail.
Thanks,
Bram