nape-js API
    Preparing search index...

    Interface FractureOptions

    Options for body fracture.

    interface FractureOptions {
        addToSpace?: boolean;
        explosionImpulse?: number;
        filter?: InteractionFilter;
        fragmentCount?: number;
        material?: Material;
        random?: () => number;
        sites?: VoronoiPoint[];
    }
    Index

    Properties

    addToSpace?: boolean

    If true, automatically add fragments to the same space as the original body and remove the original body. Default true.

    explosionImpulse?: number

    Explosion impulse magnitude applied radially from the impact point. Default 0 (no explosion impulse — fragments inherit body velocity).

    Interaction filter for all fragment shapes.

    fragmentCount?: number

    Number of fracture fragments to generate. Default 8.

    material?: Material

    Material to apply to all fragment shapes. If not specified, the first shape's material is copied from the original body.

    random?: () => number

    Custom RNG function for reproducible fracture patterns. Default Math.random.

    sites?: VoronoiPoint[]

    Custom Voronoi site positions (in body-local space). If provided, fragmentCount is ignored and these exact sites are used.