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; }
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; }