OSDN Git Service

Don't interpolate when parent changes (sit/stand link/unlink)
authorLatif Khalifa <latifer@streamgrid.net>
Thu, 11 Aug 2011 13:20:22 +0000 (13:20 +0000)
committerLatif Khalifa <latifer@streamgrid.net>
Thu, 11 Aug 2011 13:20:22 +0000 (13:20 +0000)
Fixes wild avatar movements on sitting/unsitting.

git-svn-id: https://radegast.googlecode.com/svn/trunk@1087 f7a694da-4d33-11de-9ad6-1127a62b9fcd

Radegast/GUI/Rendering/RenderingHelpers.cs

index a452a75..1937a51 100644 (file)
@@ -347,6 +347,8 @@ namespace Radegast.Rendering
 \r
         #endregion Public fields\r
 \r
+        uint previousParent = uint.MaxValue;\r
+\r
         /// <summary>\r
         /// Cleanup resources used\r
         /// </summary>\r
@@ -370,6 +372,14 @@ namespace Radegast.Rendering
         /// <param name="time">Time since the last call (last frame time in seconds)</param>\r
         public virtual void Step(float time)\r
         {\r
+            if (previousParent != BasePrim.ParentID)\r
+            {\r
+                previousParent = BasePrim.ParentID;\r
+                InterpolatedPosition = BasePrim.Position;\r
+                InterpolatedRotation = BasePrim.Rotation;\r
+                return;\r
+            }\r
+\r
             // Linear velocity and acceleration\r
             if (BasePrim.Velocity != Vector3.Zero)\r
             {\r