OpenSim/Framework/Util.cs
/// <summary>
/// Returns true if the distance beween A and B is less than amount. Significantly faster than GetDistanceTo since it eliminates the Sqrt.
/// </summary>
/// <param name="a"></param>
/// <param name="b"></param>
/// <param name="amount"></param>
/// <returns></returns>
Returns true if the distance beween A and B is less than amount. Significantly faster than GetDistanceTo since it eliminates the Sqrt.
Returns true if the distance beween A and B is less than amount . Significantly faster than GetDistanceTo since it eliminates the Sqrt .
public static bool DistanceLessThan(Vector3 a, Vector3 b, double amount)
        {
            float dx = a.X - b.X;
            float dy = a.Y - b.Y;
            float dz = a.Z - b.Z;
            return (dx*dx + dy*dy + dz*dz) < (amount*amount);
        }
public static bool DistanceLessThan ( Vector3 a , Vector3 b , double amount ) { float dx = a . X - b . X ; float dy = a . Y - b . Y ; float dz = a . Z - b . Z ; return ( dx * dx + dy * dy + dz * dz ) < ( amount * amount ) ; }
Returns true if the distance beween A and B is less than amount.
Returns true if the distance beween A and B is less than amount .
None
a
Vector3
None
b
Vector3
None
amount
double
None