public static bool TestAABBSphere(AABB aabb, Sphere sphere) { Vector3 p = aabb.ClosestPoint(sphere.center); Vector3 d = sphere.center - p; return(Vector3.Dot(d, d) <= sphere.radius * sphere.radius); }
public static bool TestAABBSphere(AABB aabb, Sphere sphere) { Vector3 p = aabb.ClosestPoint(sphere.center); Vector3 d = sphere.center - p; return(Vector3.Dot(d, d) <= sphere.radius * sphere.radius); }