applyForce(bodyName, force, point?)
Apply a force to a body at an optional point.Name of the body to apply force to.
Force vector in world coordinates (Newtons).
Application point in world coordinates. If omitted, force is applied at the body’s center of mass.
applyTorque(bodyName, torque)
Apply a pure torque to a body.Name of the body.
Torque vector in world coordinates (N·m).
setExternalForce(bodyName, force, torque)
Set both force and torque on a body viaxfrc_applied.
Name of the body.
Force vector (N).
Torque vector (N·m).
xfrc_applied layout per body is [torque(3), force(3)]. This method writes both components.applyGeneralizedForce(values)
Apply forces in generalized (joint) coordinates.Array of length
model.nv with forces/torques in generalized coordinates.Important: Force Lifecycle
The provider zerosqfrc_applied at the start of each frame. Forces applied via these API methods (or useBeforePhysicsStep) only persist for one physics step.
To apply a continuous force, call it every frame:
setCtrl(nameOrValues, value?)
Set actuator controls by name or as a batch.Actuator name (with
value param) or object mapping names to values.Control value (when
nameOrValues is a string).getCtrl()
Get all actuator control values.Float64Array