diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 1591cb1..8815a28 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -8912,6 +8912,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8912 | elemLength = 3; | 8912 | elemLength = 3; |
8913 | 8913 | ||
8914 | List<KeyframeMotion.Keyframe> keyframes = new List<KeyframeMotion.Keyframe>(); | 8914 | List<KeyframeMotion.Keyframe> keyframes = new List<KeyframeMotion.Keyframe>(); |
8915 | bool hasTranslation = (data & KeyframeMotion.DataFormat.Translation) != 0; | ||
8916 | bool hasRotation = (data & KeyframeMotion.DataFormat.Rotation) != 0; | ||
8915 | while (idx < frames.Data.Length) | 8917 | while (idx < frames.Data.Length) |
8916 | { | 8918 | { |
8917 | int remain = frames.Data.Length - idx; | 8919 | int remain = frames.Data.Length - idx; |
@@ -8923,16 +8925,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8923 | frame.Position = null; | 8925 | frame.Position = null; |
8924 | frame.Rotation = null; | 8926 | frame.Rotation = null; |
8925 | 8927 | ||
8926 | if ((data & KeyframeMotion.DataFormat.Translation) != 0) | 8928 | if (hasTranslation) |
8927 | { | 8929 | { |
8928 | LSL_Types.Vector3 tempv = frames.GetVector3Item(idx++); | 8930 | LSL_Types.Vector3 tempv = frames.GetVector3Item(idx++); |
8929 | frame.Position = new Vector3((float)tempv.x, (float)tempv.y, (float)tempv.z); | 8931 | frame.Position = new Vector3((float)tempv.x, (float)tempv.y, (float)tempv.z); |
8930 | } | 8932 | } |
8931 | if ((data & KeyframeMotion.DataFormat.Rotation) != 0) | 8933 | if (hasRotation) |
8932 | { | 8934 | { |
8933 | LSL_Types.Quaternion tempq = frames.GetQuaternionItem(idx++); | 8935 | LSL_Types.Quaternion tempq = frames.GetQuaternionItem(idx++); |
8934 | Quaternion q = new Quaternion((float)tempq.x, (float)tempq.y, (float)tempq.z, (float)tempq.s); | 8936 | Quaternion q = new Quaternion((float)tempq.x, (float)tempq.y, (float)tempq.z, (float)tempq.s); |
8935 | q.Normalize(); | ||
8936 | frame.Rotation = q; | 8937 | frame.Rotation = q; |
8937 | } | 8938 | } |
8938 | 8939 | ||