Engines/FlatRedBallXNA/FlatRedBall/Math/Geometry/Sphere.cs
/// <summary>
/// Returns whether this instance overlaps the argument Sphere.
/// </summary>
/// <param name="sphere">The other Sphere to test against.</param>
/// <returns>Whether collision has occurred.</returns>
Returns whether this instance overlaps the argument Sphere.
Returns whether this instance overlaps the argument Sphere .
public bool CollideAgainst(Sphere sphere)
        {
            UpdateDependencies(TimeManager.CurrentTime);
            sphere.UpdateDependencies(TimeManager.CurrentTime);
            float differenceX = X - sphere.X;
            float differenceY = Y - sphere.Y;
            float differenceZ = Z - sphere.Z;
            double differenceSquared = differenceX * differenceX + differenceY * differenceY + differenceZ * differenceZ;
            return (System.Math.Pow(differenceSquared, .5) - Radius - sphere.Radius < 0);
        }
public bool CollideAgainst ( Sphere sphere ) { UpdateDependencies ( TimeManager . CurrentTime ) ; sphere . UpdateDependencies ( TimeManager . CurrentTime ) ; float differenceX = X - sphere . X ; float differenceY = Y - sphere . Y ; float differenceZ = Z - sphere . Z ; double differenceSquared = differenceX * differenceX + differenceY * differenceY + differenceZ * differenceZ ; return ( System . Math . Pow ( differenceSquared , .5 ) - Radius - sphere . Radius < 0 ) ; }
Returns whether this instance overlaps the argument Sphere.
Returns whether this instance overlaps the argument Sphere .
Whether collision has occurred.
Whether collision has occurred .
sphere
Sphere
The other Sphere to test against.
The other Sphere to test against .