Utility Scripts · Physical Controls

Direct Torque

Direct torque applies a persistent signed effort to Wheel/Crank without regulating speed or position.

GML
control.set_torque_mode(options)
control.get_torque_mode()
ItemMeaning / default
enabledtrue
torqueDefault 0 N·m; finite positive, negative or zero value within the native input range.
activeGetter only: current drive ownership.

Example#

GML
wheel = jolt_control_wheel({torque_mode: {torque: 0.5}});
// Change torque direction later:
wheel.set_torque_mode({torque: -0.5});
// Zero torque does not brake:
wheel.set_torque_mode({torque: 0});
wheel.set_torque_mode({enabled: false});

Torque acts around mounting +Z using the right-hand rule, independently of the sign of current speed. Each native substep applies angular impulse torque × dt. A Dynamic parent receives the opposite reaction. There is no max_torque or automatic speed correction: torque is the directly applied value. Resistance can reduce or hold the resulting motion.

Verified operation contracts#

These contracts distinguish units, return values, errors and lifetime according to the current implementation. Check results: false, 0 and undefined can mean different things for different methods.

Symbol / ownerSignatureOperation contract
JoltControl.get_torque_modeJoltControl.get_torque_mode()Wheel/Crank; config enabled defaults true, finite signed torque N·m defaults 0. Setter Boolean, getter {enabled, torque, active} or undefined. Enabled and actually active differ.
JoltControl.set_torque_modeJoltControl.set_torque_mode(options)Wheel/Crank; config enabled defaults true, finite signed torque N·m defaults 0. Setter Boolean, getter {enabled, torque, active} or undefined. Enabled and actually active differ.