ecspresso
    Preparing search index...

    Interface RigidBody

    Rigid body component controlling physics behavior.

    interface RigidBody {
        drag: number;
        friction: number;
        gravityScale: number;
        mass: number;
        restitution: number;
        type: BodyType;
    }
    Index

    Properties

    drag: number

    Linear velocity damping coefficient (units/sec, 0 = none)

    friction: number

    Surface friction coefficient 0–1

    gravityScale: number

    Per-entity gravity multiplier (0 = no gravity)

    mass: number

    Mass in arbitrary units. Affects force→acceleration. Infinity = immovable.

    restitution: number

    Bounciness 0–1 (0 = no bounce, 1 = perfectly elastic)

    type: BodyType