I use btRotationalLimitMotor for simulating simple actuator exerting specified torque on attached bodies.
Code: Select all
void BulletRotationalServoMotor::setTargetForce(float targetForce_)
{
targetForce = targetForce_;
motor->m_maxMotorForce = fabs(targetForce);
motor->m_enableMotor = motor->m_maxMotorForce > 0.01f;
if (motor->m_enableMotor) {
motor->m_targetVelocity = targetForce / motor->m_maxMotorForce * btScalar(BT_LARGE_FLOAT);
}
}
Is there a better way to implement servo motor? Does the btRotationalLimitMotor use units other than N·m?