public static bool FastIntersects(this BoundingFrustum boundingfrustum, ref BoundingBox aabb) { if (boundingfrustum == null) { return false; } Plane plane; Vector3 normal, p; plane = boundingfrustum.Bottom; normal = plane.Normal; normal.X = -normal.X; normal.Y = -normal.Y; normal.Z = -normal.Z; p = aabb.GetPositiveVertex (ref normal); if (-plane.D + normal.X * p.X + normal.Y * p.Y + normal.Z * p.Z < 0) { return false; } plane = boundingfrustum.Far; normal = plane.Normal; normal.X = -normal.X; normal.Y = -normal.Y; normal.Z = -normal.Z; p = aabb.GetPositiveVertex (ref normal); if (-plane.D + normal.X * p.X + normal.Y * p.Y + normal.Z * p.Z < 0) { return false; } plane = boundingfrustum.Left; normal = plane.Normal; normal.X = -normal.X; normal.Y = -normal.Y; normal.Z = -normal.Z; p = aabb.GetPositiveVertex (ref normal); if (-plane.D + normal.X * p.X + normal.Y * p.Y + normal.Z * p.Z < 0) { return false; } plane = boundingfrustum.Near; normal = plane.Normal; normal.X = -normal.X; normal.Y = -normal.Y; normal.Z = -normal.Z; p = aabb.GetPositiveVertex (ref normal); if (-plane.D + normal.X * p.X + normal.Y * p.Y + normal.Z * p.Z < 0) { return false; } plane = boundingfrustum.Right; normal = plane.Normal; normal.X = -normal.X; normal.Y = -normal.Y; normal.Z = -normal.Z; p = aabb.GetPositiveVertex (ref normal); if (-plane.D + normal.X * p.X + normal.Y * p.Y + normal.Z * p.Z < 0) { return false; } plane = boundingfrustum.Top; normal = plane.Normal; normal.X = -normal.X; normal.Y = -normal.Y; normal.Z = -normal.Z; p = aabb.GetPositiveVertex (ref normal); if (-plane.D + normal.X * p.X + normal.Y * p.Y + normal.Z * p.Z < 0) { return false; } return true; }