Skip to main content

Interface: AngularVelocityMotorEcsComponent

Defined in: physics/components/angular-velocity-motor-component.ts:14

ECS-style component interface for a controlled rotational motor. Unlike a one-shot or manually-driven torque (applied directly via RigidBody.applyTorque, with no engine-provided component of its own), this drives the entity's PhysicsBodyEcsComponent.physicsBody towards targetVelocity every tick, spending no more than maxTorque to do so. Register createAngularVelocityMotorEcsSystem to apply it. Use this for a spinning fan, or a car wheel that should hold a speed rather than receive a one-shot push.

Properties

maxTorque

maxTorque: number

Defined in: physics/components/angular-velocity-motor-component.ts:26

The maximum torque, in N·m, the motor may apply in a single tick while driving towards targetVelocity. Limits how quickly angular velocity can change; a body with high inertia relative to maxTorque approaches targetVelocity gradually rather than snapping to it.


targetVelocity

targetVelocity: number

Defined in: physics/components/angular-velocity-motor-component.ts:18

The angular velocity this motor drives the body towards, in rad/s.