Exemplo n.º 1
0
    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);
    }