crashcat docs
    Preparing search index...

    Type Alias Support

    type Support = {
        addRadius: number;
        box: { halfExtents: Vec3 };
        capsule: { halfHeight: number; radius: number };
        convexRadius: number;
        cylinder: { halfHeight: number; radius: number };
        hasTransform: boolean;
        hull: {
            lastVertex: number;
            neighbors: number[];
            neighborsStart: number[];
            outputScale: number;
            scratch: number[];
            vertexCount: number;
            vertices: number[];
        };
        kind: SupportKind;
        point: { position: Vec3 };
        sphere: { radius: number };
        transform: Mat4;
        triangle: { a: Vec3; b: Vec3; c: Vec3 };
    }
    Index

    Properties

    addRadius: number

    extra radius added along the local direction by getSupport (EPA separation / cast radius)

    box: { halfExtents: Vec3 }

    axis-aligned box: support is the corner picked by the sign of the direction on each axis (±halfExtents)

    capsule: { halfHeight: number; radius: number }

    capsule as a segment of half-length halfHeight along local Y, optionally rounded by radius. radius 0 → the bare segment endpoint (exclude); r → segment endpoint + r·dir̂ (include).

    convexRadius: number

    reported convex radius — read by the driver, never added by getSupport (0 in include mode)

    cylinder: { halfHeight: number; radius: number }

    cylinder: radius is the radial extent in the local XZ plane, halfHeight the axial extent along local Y. support = the radial extreme (radius·dir̂ₓ_z) combined with the near/far axial cap.

    hasTransform: boolean

    B-in-A transform, applied when hasTransform is true (identity otherwise)

    hull: {
        lastVertex: number;
        neighbors: number[];
        neighborsStart: number[];
        outputScale: number;
        scratch: number[];
        vertexCount: number;
        vertices: number[];
    }

    convex vertex set — support is the vertex with the greatest dot product against the direction

    Type Declaration

    • lastVertex: number

      warm-start hint: the last winning vertex index, carried across support calls within one pair; -1 = cold

    • neighbors: number[]

      borrowed CSR flat neighbour indices (shape-owned), indexed via neighborsStart

    • neighborsStart: number[]

      borrowed CSR neighbour prefix offsets (shape-owned, length numPoints+1); empty ⇔ brute scan

    • outputScale: number

      per-vertex output scale — the winning vertex is multiplied by this (uniform-scale fast path); 1 when vertices are already baked

    • scratch: number[]

      owned grow-once buffer that vertices points at for the non-uniform scaled slow path

    • vertexCount: number

      number of vertices in vertices (it may be longer than vertexCount * 3)

    • vertices: number[]

      flat [x,y,z,...] vertices scanned by getSupport; read-only borrow valid for the current pair

    which sub-object holds this support's parameters; selects the branch taken in getSupport

    point: { position: Vec3 }

    single point — the support is always this point, regardless of direction

    sphere: { radius: number }

    sphere as a single radius. 0 → the core is the origin (exclude mode: a sphere is pure convex radius); r → the rounded surface point r·dir̂ (include mode).

    transform: Mat4
    triangle: { a: Vec3; b: Vec3; c: Vec3 }

    triangle (mesh face) — support is whichever of the three vertices has the greatest dot with the direction