From fcf39601687b30f088903faaa12d2b4aaa18bf1a Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 11 Jan 2013 20:25:12 +0000 Subject: make sure keyframe rotations are normalized --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 0dfcfd6..1e1e574 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -12691,7 +12691,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if ((data & KeyframeMotion.DataFormat.Rotation) != 0) { LSL_Types.Quaternion tempq = frames.GetQuaternionItem(idx++); - frame.Rotation = new Quaternion((float)tempq.x, (float)tempq.y, (float)tempq.z, (float)tempq.s); + Quaternion q = new Quaternion((float)tempq.x, (float)tempq.y, (float)tempq.z, (float)tempq.s); + q.Normalize(); + frame.Rotation = q; } float tempf = (float)frames.GetLSLFloatItem(idx++); -- cgit v1.1