diff options
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 6f8d07c..887c7fc 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -4881,8 +4881,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
4881 | { | 4881 | { |
4882 | if (APIDTarget != Quaternion.Identity) | 4882 | if (APIDTarget != Quaternion.Identity) |
4883 | { | 4883 | { |
4884 | |||
4884 | if (m_APIDIterations <= 1) | 4885 | if (m_APIDIterations <= 1) |
4885 | { | 4886 | { |
4887 | AngularVelocity = Vector3.Zero; | ||
4886 | UpdateRotation(APIDTarget); | 4888 | UpdateRotation(APIDTarget); |
4887 | APIDTarget = Quaternion.Identity; | 4889 | APIDTarget = Quaternion.Identity; |
4888 | return; | 4890 | return; |
@@ -4890,7 +4892,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
4890 | 4892 | ||
4891 | Quaternion rot = Quaternion.Slerp(RotationOffset,APIDTarget,1.0f/(float)m_APIDIterations); | 4893 | Quaternion rot = Quaternion.Slerp(RotationOffset,APIDTarget,1.0f/(float)m_APIDIterations); |
4892 | rot.Normalize(); | 4894 | rot.Normalize(); |
4893 | UpdateRotation(rot); | 4895 | |
4896 | Quaternion dR = rot / RotationOffset; | ||
4897 | Vector3 axis; | ||
4898 | float angle; | ||
4899 | dR.GetAxisAngle(out axis, out angle); | ||
4900 | axis *= RotationOffset; | ||
4901 | axis.Normalize(); | ||
4902 | axis *= angle / 11; // simulator update frequency is 10-11 Hz | ||
4903 | AngularVelocity = axis; | ||
4894 | 4904 | ||
4895 | m_APIDIterations--; | 4905 | m_APIDIterations--; |
4896 | 4906 | ||