Documentation
    Preparing search index...

    Interface ColliderDescriptor

    How a collider is created in a solver (§37 createCollider), carrying §24's fields.

    body is required, which §24's Collider interface does not itself say. It follows from §23: "non-simulated mass is expressed through the static and kinematic body types" — static level geometry is a "static" body carrying colliders, never a body-less collider — and from §29, whose collision events name a bodyA and a bodyB unconditionally. Requiring the parent here keeps that event contract fillable (decision, WP-5.1).

    interface ColliderDescriptor {
        body: PhysicsBodyHandle;
        collisionGroups?: number;
        collisionMask?: number;
        density?: number;
        friction?: number;
        material?: PhysicsMaterial;
        offset?: Transform;
        restitution?: number;
        sensor?: boolean;
        shape: CollisionShape;
    }
    Index

    The body this collider is attached to (§37). See above for why required.

    collisionGroups?: number

    Bit set of the groups this collider belongs to (§24). Defaults to ALL_COLLISION_GROUPS — see queries.ts for the group/mask rule, which queries and contact filtering share.

    collisionMask?: number

    Bit set of the groups this collider collides with (§24).

    density?: number

    Mass per unit volume in kg/m³ (§24). Authoritative for mass derivation (§25): PhysicsMaterial.density is only a fallback when this is absent.

    friction?: number

    Coulomb friction coefficient (§24). Finite and >= 0.

    material?: PhysicsMaterial

    Material supplying friction, restitution, and the §25 density fallback. The explicit fields below win over it where both are present.

    offset?: Transform

    Pose of the shape in the body's local frame (§24 Collider.offset).

    Only position and rotation are read: a collider has no scale, and scaling a solver shape at runtime is not a §24 feature — resize the shape instead. pivot is likewise ignored. Defaults to the identity pose.

    restitution?: number

    Bounciness in [0, 1] for a passive contact (§24). Values above 1 add energy at every bounce; they are permitted (some engineering models want them) but validated as finite and >= 0 only.

    sensor?: boolean

    A sensor reports overlaps but exerts no forces (§24, Appendix B) and emits triggerenter/triggerexit rather than collision events (§29). Defaults to false.

    The collider's geometry (§24), which must suit the world's dimension.