Hi everyone, Im trying to add the motor control Function to my softbody vehicles Angular Joint just like in the SofBody Demo but it seems to have no effect.
static struct MotorControl : btSoftBody::AJoint::IControl
{
MotorControl()
{
goal+=1;
maxtorque=10;
}
btScalar Speed(btSoftBody::AJoint*,btScalar current)
{
return(current+btMin(maxtorque,btMax(-maxtorque,goal-current)));
}
btScalar goal;
btScalar maxtorque;
} motorcontrol;
btSoftBody::LJoint::Specs ls;
ls.cfm = 1;
ls.erp = 0.5;
ls.position = btVector3(0, 0, 0);
Truck->appendLinearJoint(ls,WheelA);
btSoftBody::AJoint::Specs aspecs;
aspecs.cfm = 1;
aspecs.erp = 1;
aspecs.axis = btVector3(0,0,0.1);
aspecs.icontrol = &motorcontrol;
Truck->appendAngularJoint(aspecs,WheelA);
Changing the values for goal and maxtorque has no effect, I also tried addForce to WheelA but it has no effect either.
Any help would be greatly appreciated.
Thank You