Function intrSphereVsAABB

Checks sphere and AABB for intersection

Intersection intrSphereVsAABB (
  ref Sphere sphere,
  ref AABB aabb
);

Example

Sphere sphere = Sphere(Vector3f(1.5f, 0.0f, 0.0f), 1.0f);
AABB aabb = AABB(Vector3f(0, 0, 0), Vector3f(1, 1, 1));
Intersection intr = intrSphereVsAABB(sphere, aabb);
assert(intr.fact);
assert(isAlmostZero(intr.normal - Vector3f(-1.0f, 0.0f, 0.0f)));
assert(isConsiderZero(intr.penetrationDepth - 0.5f));