Expose HingeConstraint Readonly Property: MotorAppliedTorque

Given MotorMaxTorque, MotorMaxAcceleration, and AngularVelocity, HingeConstraint Solves for x.

Please expose ‘MotorAppliedTorque’. I need it for the following usecase:

I have a car with an automatic transmission. It drives up a hill. Gear1 is strong enough to reach its maxSpeed, so the system goes up to G2, not knowing that G2’s maxTorque is less than the current appliedTorque. Because this cannot be known, It goes up to G2, slows down, back to G1, and repeats, at 30hz. Yuck! On a weaker computer, this causes the car to jank, and have unfair, slower and weaker performance up the hill. Not good for competitive racing or aesthetics at all.

All we have is CurrentAngle rn. HingeConstraint is very black-box. Like most Constraints.

Exposing MotorAppliedTorque would allow my system to predict ahead and escape a nonoptimal cyclic feedback loop.

I am sure other properties such as AppliedAcceleration, AppliedAngularVelocity will serve other use-cases. A generalization of exposing Readonly’s for all Constraints would fuel creativity, function, and usage for more stable, broad and vital use-cases.

11 Likes