Provides XNA-like bounding sphere functionality.
Beispiel #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;
 }
Beispiel #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;
 }