aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/Manager/PhysicsVector.cs
diff options
context:
space:
mode:
authorTeravus Ovares2008-04-24 22:26:26 +0000
committerTeravus Ovares2008-04-24 22:26:26 +0000
commitd023c331f813598c3cabab93927a7ab105d6e7f1 (patch)
treeae7907318751d470c6032a97cd72d5dfe24ad306 /OpenSim/Region/Physics/Manager/PhysicsVector.cs
parentdo a max of 3 splits when first processing the nhibernate connect (diff)
downloadopensim-SC_OLD-d023c331f813598c3cabab93927a7ab105d6e7f1.zip
opensim-SC_OLD-d023c331f813598c3cabab93927a7ab105d6e7f1.tar.gz
opensim-SC_OLD-d023c331f813598c3cabab93927a7ab105d6e7f1.tar.bz2
opensim-SC_OLD-d023c331f813598c3cabab93927a7ab105d6e7f1.tar.xz
* Tuned the llMove2Target PID controller to be more reasonable and not overshoot the target.
Diffstat (limited to 'OpenSim/Region/Physics/Manager/PhysicsVector.cs')
-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}