crashcat docs
    Preparing search index...

    Type Alias CastShapeHit

    type CastShapeHit = {
        bodyIdB: number;
        faceA: Face;
        faceB: Face;
        fraction: number;
        materialIdA: number;
        materialIdB: number;
        normal: Vec3;
        penetrationAxis: Vec3;
        penetrationDepth: number;
        pointA: Vec3;
        pointB: Vec3;
        status: CastShapeStatus;
        subShapeIdA: number;
        subShapeIdB: number;
    }
    Index

    Properties

    bodyIdB: number

    body ID of shape B

    faceA: Face

    supporting face on shape A (world space, flat array of vertices)

    faceB: Face

    supporting face on shape B (world space, flat array of vertices)

    fraction: number

    fraction along the sweep (0=start, 1=end)

    materialIdA: number

    material ID of sub-shape A

    materialIdB: number

    material ID of sub-shape B

    normal: Vec3

    contact normal (world space, normalized). computed as -penetrationAxis.normalized(). points from shape B towards shape A (opposite of penetration axis).

    penetrationAxis: Vec3

    penetration axis: direction to move shape B out of collision along shortest path. magnitude is meaningless, in world space. when fraction > 0: this is the contact normal (A → B) when fraction = 0: this is the penetration direction

    penetrationDepth: number

    penetration depth

    pointA: Vec3

    point on shape A (world space)

    pointB: Vec3

    point on shape B (world space)

    status of the cast

    subShapeIdA: number

    sub-shape ID on shape A

    subShapeIdB: number

    sub-shape ID on shape B