crashcat docs
    Preparing search index...

    Type Alias RigidBody

    physics body in a physics world

    type RigidBody = {
        _pooled: boolean;
        aabb: Box3;
        activeIndex: number;
        broadphaseLayer: number;
        ccdBodyIndex: number;
        centerOfMassPosition: Vec3;
        collideKinematicVsNonDynamic: boolean;
        collisionGroups: number;
        collisionMask: number;
        constraintIds: ConstraintId[];
        contactCount: number;
        dbvtNode: number;
        enhancedInternalEdgeRemoval: boolean;
        friction: number;
        frictionCombineMode: MaterialCombineMode;
        headContactKey: number;
        id: BodyId;
        index: number;
        islandIndex: number;
        massProperties: MassProperties;
        massPropertiesOverride: MassPropertiesOverride;
        motionProperties: MotionProperties;
        motionType: MotionType;
        objectLayer: number;
        position: Vec3;
        quaternion: Quat;
        restitution: number;
        restitutionCombineMode: MaterialCombineMode;
        sensor: boolean;
        sequence: number;
        shape: Shape;
        sleeping: boolean;
        useManifoldReduction: boolean;
        userData: unknown | null;
    }
    Index

    Properties

    _pooled: boolean

    whether this body is currently pooled, in which case it should be ignored

    aabb: Box3

    world-space AABB

    activeIndex: number

    active body index for island building (sequential index 0,1,2... for dynamic+kinematic bodies, -1 for static)

    broadphaseLayer: number

    broadphase layer this body is in, -1 if none

    ccdBodyIndex: number

    CCD body index (index into world.ccd.ccdBodies array, -1 if not using CCD this frame)

    centerOfMassPosition: Vec3

    world-space center of mass position

    collideKinematicVsNonDynamic: boolean

    whether kinematic bodies can collide with static/other kinematic bodies

    collisionGroups: number

    collision group bitfield - "I am in these groups"

    collisionMask: number

    collision mask bitfield - "I collide with these groups"

    constraintIds: ConstraintId[]

    constraint IDs referencing this body (for cleanup on body removal)

    contactCount: number

    number of contacts involving this body

    dbvtNode: number

    which broadphase dbvt node contains this body

    enhancedInternalEdgeRemoval: boolean

    enable enhanced internal edge removal to eliminate ghost collisions on internal edges

    friction: number

    coefficient of friction

    frictionCombineMode: MaterialCombineMode

    how to combine friction when this body collides with another

    headContactKey: number

    Head of the intrusive doubly-linked list of contacts involving this body. Packed key: (contactId << 1) | edgeIndex. Use INVALID_CONTACT_KEY (-1) for empty list.

    id: BodyId

    unique body identifier

    index: number

    index from body ID (index into World.bodies array)

    islandIndex: number

    island index this body belongs to (set during island building, -1 if not in an island)

    massProperties: MassProperties

    mass properties (mass, inertia tensor, etc.)

    massPropertiesOverride: MassPropertiesOverride

    how mass properties are calculated/overridden

    motionProperties: MotionProperties

    motion properties (velocity, forces, damping, etc.)

    motionType: MotionType

    the body's motion type

    objectLayer: number

    object layer this body is in

    position: Vec3

    the body's world-space position at the shape origin,

    centerOfMassPosition for the center of mass position

    quaternion: Quat

    the body's orientation

    restitution: number

    coefficient of restitution (bounciness)

    restitutionCombineMode: MaterialCombineMode

    how to combine restitution when this body collides with another

    sensor: boolean

    whether this body is a sensor (detects collisions but does not respond physically)

    sequence: number

    sequence number from body ID (for fast stale reference detection)

    shape: Shape

    the body's shape

    sleeping: boolean

    whether the body is currently sleeping

    useManifoldReduction: boolean

    whether to use manifold reduction for this body. if you requires tracking exactly which sub shape ids are in contact, you can turn off manifold reduction. note that this comes at a performance cost. manifold reduction by default will combine contacts with similar normals that come from different sub shape ids (e.g. different triangles in a mesh shape or different compound shapes).

    userData: unknown | null

    an optional user-defined field, defaults to null