From 3d0f110f21078a0b96b0d21b6a5ee1e27ce291c9 Mon Sep 17 00:00:00 2001 From: Dahlia Trimble Date: Thu, 21 May 2009 19:44:20 +0000 Subject: normalize quats before applying llSetRot() --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 5b6f23a..519dd2b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -347,7 +347,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // convert a LSL_Rotation to a Quaternion private Quaternion Rot2Quaternion(LSL_Rotation r) { - return new Quaternion((float)r.x, (float)r.y, (float)r.z, (float)r.s); + Quaternion q = new Quaternion((float)r.x, (float)r.y, (float)r.z, (float)r.s); + q.Normalize(); + return q; } //These are the implementations of the various ll-functions used by the LSL scripts. -- cgit v1.1