aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
diff options
context:
space:
mode:
authordahlia2015-02-07 14:17:37 -0800
committerdahlia2015-02-07 14:17:37 -0800
commit2ed1afd32b1d7573dec664d61538475523b10edc (patch)
tree19416a13d2e09b32e6b9c036e6747c025735168b /OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
parentllLookAt() and llRotLookAt(): all orientation updates now done via angular ve... (diff)
downloadopensim-SC_OLD-2ed1afd32b1d7573dec664d61538475523b10edc.zip
opensim-SC_OLD-2ed1afd32b1d7573dec664d61538475523b10edc.tar.gz
opensim-SC_OLD-2ed1afd32b1d7573dec664d61538475523b10edc.tar.bz2
opensim-SC_OLD-2ed1afd32b1d7573dec664d61538475523b10edc.tar.xz
llLookAt(): reduce and clamp strengh to reduce probability of overshoot
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs7
1 files changed, 5 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index ea0245c..8d28915 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -4910,10 +4910,13 @@ namespace OpenSim.Region.Framework.Scenes
4910 if (angle > Math.PI) 4910 if (angle > Math.PI)
4911 angle = 2.0f * (float)Math.PI - angle; 4911 angle = 2.0f * (float)Math.PI - angle;
4912 4912
4913 // clamp strength to avoid overshoot
4914 float strength = APIDStrength;
4915 if (strength > 1.0) strength = 1.0f;
4916
4913 // set angular velocity to rotate to desired orientation 4917 // set angular velocity to rotate to desired orientation
4914 // with velocity proportional to strength and angle 4918 // with velocity proportional to strength and angle
4915 // the factor of 10 seems to make rotation speed closer to LL implementation 4919 AngularVelocity = axis * angle * strength * (float)Math.PI;
4916 AngularVelocity = axis * angle * APIDStrength * (float)Math.PI * 10.0f;
4917 4920
4918 // This ensures that we'll check this object on the next iteration 4921 // This ensures that we'll check this object on the next iteration
4919 ParentGroup.QueueForUpdateCheck(); 4922 ParentGroup.QueueForUpdateCheck();