jakke-graphics-ts
    Preparing search index...

    Function hasBoundingBoxCollision3d

    • Determines whether two 3D bounding boxes collide using the Separating Axis Theorem (SAT).

      This function checks for collision between two oriented bounding boxes (OBBs) in 3D space. It validates the input axes, ensures perpendicularity, and projects the box corners onto relevant axes to detect separation. Optionally, it can include contacting (touching) cases as collisions.

      Parameters

      • boxA: BoundingBox3d

        The first bounding box, defined by anchor, axes, and lengths.

      • boxB: BoundingBox3d

        The second bounding box, defined by anchor, axes, and lengths.

      • includeContating: boolean = false

        If true, boxes that are merely touching are considered colliding. Defaults to false.

      Returns ActionResult<SATSections>

      An ActionResult containing the SAT section results, collision status, and error information.

      • Returns an error if any axis is a zero vector or if the u/v axes of a box are not perpendicular.
      • Uses a tolerance for zero vectors and perpendicularity checks.
      • The result includes detailed projection sections for each axis tested.