* Tuned the llMove2Target PID controller to be more reasonable and not overshoot the target.

This commit is contained in:
Teravus Ovares
2008-04-24 22:26:26 +00:00
parent 03c7055902
commit d023c331f8
2 changed files with 33 additions and 8 deletions

View File

@@ -130,6 +130,14 @@ namespace OpenSim.Region.Physics.Manager
return (float) Math.Sqrt(X*X + Y*Y + Z*Z);
}
public static float GetDistanceTo(PhysicsVector a, PhysicsVector b)
{
float dx = a.X - b.X;
float dy = a.Y - b.Y;
float dz = a.Z - b.Z;
return (float) Math.Sqrt(dx * dx + dy * dy + dz * dz);
}
public static PhysicsVector operator /(PhysicsVector v, float f)
{
return new PhysicsVector(v.X/f, v.Y/f, v.Z/f);
@@ -154,5 +162,6 @@ namespace OpenSim.Region.Physics.Manager
return false;
}
}
}