* 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:
Adam Frisby
2009-02-23 06:55:42 +00:00
parent dba8c90611
commit c2f3ff872d
4 changed files with 35 additions and 4 deletions

View File

@@ -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>