mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 03:45:35 +08:00
* Performance Changes:
* Moves Entity Updates into a seperate thread, allowing for OpenSim to utilize a computers CPU more effectively in return for potentially greater user and prim capacity. * Removes an expensive Sqrt call performed during Update on each object. This should lower CPU requirements for high-prim regions with physics enabled. * MXP Changes: Centers the region around 0,0 for primitives instead of 128,128. Prim display should now look more correct for MXP viewers.
This commit is contained in:
@@ -88,6 +88,21 @@ namespace OpenSim.Framework
|
||||
return Math.Sqrt(dx * dx + dy * dy + dz * dz);
|
||||
}
|
||||
|
||||
/// <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>
|
||||
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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the magnitude of a 3d vector
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user