Documentation
    Preparing search index...

    Class MotionComponent

    Procedural motion state attached to a node (§11), advanced by MotionSystem.

    A component per plan D2: a class with a static readonly typeName, one per node, attached with node.addComponent(new MotionComponent(...)) exactly as §11's example does. It holds no reference to the node — host is assigned by the registry — and no behaviour, so a component that is never tracked simply never moves anything.

    The four vectors are owned by the component and are never replaced by it; write into them (motion.linearVelocity.set(...)) or assign a new vector if you prefer — the system re-reads the fields every step either way.

    Implements

    Index
    angularAcceleration: Vector3

    Constant angular acceleration in radians per second squared.

    angularDamping: number

    Angular damping rate per second, >= 0. 0 disables damping.

    angularVelocity: Vector3

    Angular velocity as an axis-angle rate vector in radians per second.

    damping: number

    Linear damping rate per second, >= 0. 0 disables damping.

    host: ComponentHost | null

    The node this component is attached to, or null. Written by the ComponentRegistry alone (§6a); never assign it.

    linearAcceleration: Vector3

    Constant linear acceleration in units per second squared.

    linearVelocity: Vector3

    Linear velocity in units per second.

    maxAngularSpeed?: number

    Optional angular speed limit in radians per second, >= 0.

    maxSpeed?: number

    Optional linear speed limit in units per second, >= 0.

    typeName: "motion"

    Component key (plan D2) and §79 serialization name.

    • Zeroes both velocities and both accelerations. Limits and damping are kept.

      Returns this