Provides XNA-like bounding sphere functionality.
예제 #1
0
 public static void CreateFromSphere(ref BoundingSphere boundingSphere, out BoundingBox boundingBox)
 {
     var radius = new Vector3(boundingSphere.Radius);
     boundingBox.Min = boundingSphere.Center - radius;
     boundingBox.Max = boundingSphere.Center + radius;
 }
예제 #2
0
 public bool Intersects(ref BoundingSphere boundingSphere)
 {
     var offset = boundingSphere.Center - Vector3.Min(Vector3.Max(boundingSphere.Center, Min), Max);
     return Vector3.Dot(offset, offset) <= boundingSphere.Radius * boundingSphere.Radius;
 }