crashcat docs
    Preparing search index...

    Function collideSphereVsBox

    • Analytical sphere vs box collision. A is the sphere, B is the box.

      Closed-form clamp of the sphere centre to the box's shrunk core (half-extents minus convex radius, mirroring setBoxSupport EXCLUDE_CONVEX_RADIUS), with the combined radius handling the rounded shell. Skips GJK/EPA entirely; the deep (centre-inside-core) case degrades to a per-axis SAT scan rather than EPA. Bit-equivalent to convex.collideConvexVsConvex on shallow contacts.

      The mathcat frame transforms are written idiomatically; compilecat's @optimize (flatten + SROA) inlines the vec3/quat calls and localises the literal-initialised scratch, so the hot path compiles to straight-line scalar arithmetic with no module-array round-trips or calls. (The faces branch keeps its scratch arrays — they feed the un-inlined getShapeSupportingFace.)

      Parameters

      • collector: CollideShapeCollector
      • settings: CollideShapeSettings
      • shapeA: Shape
      • subShapeIdA: number
      • _subShapeIdBitsA: number
      • posAX: number
      • posAY: number
      • posAZ: number
      • _quatAX: number
      • _quatAY: number
      • _quatAZ: number
      • _quatAW: number
      • scaleAX: number
      • _scaleAY: number
      • _scaleAZ: number
      • shapeB: Shape
      • subShapeIdB: number
      • _subShapeIdBitsB: number
      • posBX: number
      • posBY: number
      • posBZ: number
      • quatBX: number
      • quatBY: number
      • quatBZ: number
      • quatBW: number
      • scaleBX: number
      • scaleBY: number
      • scaleBZ: number

      Returns void