crashcat docs
    Preparing search index...

    Type Alias ContactManifold

    Contact manifold between two shapes.

    Contact points are stored relative to baseOffset.

    Pre-allocates space for 64 contact points During manifold generation:

    • ManifoldBetweenTwoFaces fills with up to 64 points
    • PruneContactPoints reduces to max 4 points in-place
    • numContactPoints tracks the current count
    type ContactManifold = {
        baseOffset: Vec3;
        materialIdA: number;
        materialIdB: number;
        numContactPoints: number;
        penetrationDepth: number;
        relativeContactPointsOnA: number[];
        relativeContactPointsOnB: number[];
        subShapeIdA: number;
        subShapeIdB: number;
        worldSpaceNormal: Vec3;
    }
    Index

    Properties

    baseOffset: Vec3

    base offset for all contact points

    materialIdA: number

    material id of sub-shape A

    materialIdB: number

    material id of sub-shape B

    numContactPoints: number

    number of active contact points (0-64 during clipping, 0-4 after reduction)

    penetrationDepth: number

    penetration depth for the entire manifold (single value, not per-point)

    relativeContactPointsOnA: number[]

    contact point positions on shape A relative to baseOffset (flat array: [x1,y1,z1, x2,y2,z2, ...])

    relativeContactPointsOnB: number[]

    contact point positions on shape B relative to baseOffset (flat array: [x1,y1,z1, x2,y2,z2, ...])

    subShapeIdA: number

    sub-shape id of shape A

    subShapeIdB: number

    sub-shape id of shape B

    worldSpaceNormal: Vec3

    contact normal (world space, normalized, points from A to B)