aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/Manager
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/Manager')
-rw-r--r--OpenSim/Region/Physics/Manager/PhysicsVector.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/OpenSim/Region/Physics/Manager/PhysicsVector.cs b/OpenSim/Region/Physics/Manager/PhysicsVector.cs
index 4ec943c..adf4715 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsVector.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsVector.cs
@@ -130,6 +130,14 @@ namespace OpenSim.Region.Physics.Manager
130 return (float) Math.Sqrt(X*X + Y*Y + Z*Z); 130 return (float) Math.Sqrt(X*X + Y*Y + Z*Z);
131 } 131 }
132 132
133 public static float GetDistanceTo(PhysicsVector a, PhysicsVector b)
134 {
135 float dx = a.X - b.X;
136 float dy = a.Y - b.Y;
137 float dz = a.Z - b.Z;
138 return (float) Math.Sqrt(dx * dx + dy * dy + dz * dz);
139 }
140
133 public static PhysicsVector operator /(PhysicsVector v, float f) 141 public static PhysicsVector operator /(PhysicsVector v, float f)
134 { 142 {
135 return new PhysicsVector(v.X/f, v.Y/f, v.Z/f); 143 return new PhysicsVector(v.X/f, v.Y/f, v.Z/f);
@@ -154,5 +162,6 @@ namespace OpenSim.Region.Physics.Manager
154 162
155 return false; 163 return false;
156 } 164 }
165
157 } 166 }
158} 167}