aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Util.cs
diff options
context:
space:
mode:
authorAdam Frisby2009-02-23 06:55:42 +0000
committerAdam Frisby2009-02-23 06:55:42 +0000
commitc2f3ff872dd88b4382b41844a4faa632129d1760 (patch)
tree5a0b731bcdcff54b4a5dcaa65acc7a60310a0116 /OpenSim/Framework/Util.cs
parentLoad default assets when AssetInventory starts. (diff)
downloadopensim-SC-c2f3ff872dd88b4382b41844a4faa632129d1760.zip
opensim-SC-c2f3ff872dd88b4382b41844a4faa632129d1760.tar.gz
opensim-SC-c2f3ff872dd88b4382b41844a4faa632129d1760.tar.bz2
opensim-SC-c2f3ff872dd88b4382b41844a4faa632129d1760.tar.xz
* 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.
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Util.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 2718072..4fce4ac 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -89,6 +89,21 @@ namespace OpenSim.Framework
89 } 89 }
90 90
91 /// <summary> 91 /// <summary>
92 /// Returns true if the distance beween A and B is less than amount. Significantly faster than GetDistanceTo since it eliminates the Sqrt.
93 /// </summary>
94 /// <param name="a"></param>
95 /// <param name="b"></param>
96 /// <param name="amount"></param>
97 /// <returns></returns>
98 public static bool DistanceLessThan(Vector3 a, Vector3 b, double amount)
99 {
100 float dx = a.X - b.X;
101 float dy = a.Y - b.Y;
102 float dz = a.Z - b.Z;
103 return (dx*dx + dy*dy + dz*dz) < (amount*amount);
104 }
105
106 /// <summary>
92 /// Get the magnitude of a 3d vector 107 /// Get the magnitude of a 3d vector
93 /// </summary> 108 /// </summary>
94 /// <param name="a">A 3d vector</param> 109 /// <param name="a">A 3d vector</param>