crashcat docs
    Preparing search index...

    Type Alias RigidBodySettings

    settings for creating a new rigid body

    type RigidBodySettings = {
        allowedDegreesOfFreedom?: number;
        allowSleeping?: boolean;
        angularDamping?: number;
        collideKinematicVsNonDynamic?: boolean;
        collisionGroups?: number;
        collisionMask?: number;
        enhancedInternalEdgeRemoval?: boolean;
        friction?: number;
        frictionCombineMode?: MaterialCombineMode;
        gravityFactor?: number;
        linearDamping?: number;
        mass?: number;
        massPropertiesOverride?: MassProperties;
        maxAngularVelocity?: number;
        maxLinearVelocity?: number;
        motionQuality?: motionProperties.MotionQuality;
        motionType: MotionType;
        objectLayer: number;
        position?: Vec3;
        quaternion?: Quat;
        restitution?: number;
        restitutionCombineMode?: MaterialCombineMode;
        sensor?: boolean;
        shape: Shape | null;
        useManifoldReduction?: boolean;
        userData?: unknown;
    }
    Index

    Properties

    allowedDegreesOfFreedom?: number

    allowed degrees of freedom

    DEFAULT_RIGID_BODY_SETTINGS

    allowSleeping?: boolean

    whether this body is allowed to sleep

    DEFAULT_RIGID_BODY_SETTINGS

    angularDamping?: number

    angular damping

    DEFAULT_RIGID_BODY_SETTINGS

    collideKinematicVsNonDynamic?: boolean

    if true, and the body MotionType is KINEMATIC, this body will collide with non-dynamic bodies

    DEFAULT_RIGID_BODY_SETTINGS

    collisionGroups?: number

    groups this body is part of

    DEFAULT_RIGID_BODY_SETTINGS

    collisionMask?: number

    groups this body collides with

    DEFAULT_RIGID_BODY_SETTINGS

    enhancedInternalEdgeRemoval?: boolean

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

    false
    
    friction?: number

    body friction

    DEFAULT_RIGID_BODY_SETTINGS

    frictionCombineMode?: MaterialCombineMode

    the material combine mode for friction

    DEFAULT_RIGID_BODY_SETTINGS

    gravityFactor?: number

    factor for gravity applied to this body

    DEFAULT_RIGID_BODY_SETTINGS

    linearDamping?: number

    linear damping

    DEFAULT_RIGID_BODY_SETTINGS

    mass?: number

    Override mass only. Inertia will be calculated from the shape and scaled to match this mass. This is ignored if massPropertiesOverride is provided.

    massPropertiesOverride?: MassProperties

    Override mass properties for this body (both mass and inertia). Useful for triangle meshes and other complex shapes where mass properties cannot be derived from the shape alone, or to use custom values. If not provided, mass properties are computed from the shape. If provided, it will be copied into the body mass properties (not referenced). Takes precedence over the mass field.

    maxAngularVelocity?: number

    max angular velocity

    DEFAULT_RIGID_BODY_SETTINGS

    maxLinearVelocity?: number

    max linear velocity

    DEFAULT_RIGID_BODY_SETTINGS

    motion quality

    MotionQuality.DISCRETE
    

    motionProperties.MotionQuality.DISCRETE

    motionType: MotionType

    motion type (static, kinematic, dynamic)

    objectLayer: number

    object layer the body belongs to

    position?: Vec3

    starting position

    [0,0,0]
    
    quaternion?: Quat

    starting quaternion

    [0,0,0,1]
    
    restitution?: number

    body restitution

    DEFAULT_RIGID_BODY_SETTINGS

    restitutionCombineMode?: MaterialCombineMode

    the material combine mode for restitution

    DEFAULT_RIGID_BODY_SETTINGS

    sensor?: boolean
    false
    
    shape: Shape | null

    shape for the body. Use null to create a body with an EmptyShape

    useManifoldReduction?: boolean

    whether to use manifold reduction for this body

    • DEFAULT_RIGID_BODY_SETTINGS
    • RigidBody.useManifoldReduction
    userData?: unknown

    an optional user-defined field, defaults to null