From 11ba471bcc68f9fc625b3f442adefc9aa2d79a49 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Tue, 11 Mar 2008 16:19:01 +0000 Subject: * Applying patch #754 - Fix for Vector Magnitude operation. Thanks cmickeyb! --- OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index b744ee4..e332f0f 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -191,13 +191,13 @@ namespace OpenSim.Region.ScriptEngine.Common public double llVecMag(LSL_Types.Vector3 v) { m_host.AddScriptLPS(1); - return (v.x * v.x + v.y * v.y + v.z * v.z); + return Math.Sqrt(v.x * v.x + v.y * v.y + v.z * v.z); } public LSL_Types.Vector3 llVecNorm(LSL_Types.Vector3 v) { m_host.AddScriptLPS(1); - double mag = v.x * v.x + v.y * v.y + v.z * v.z; + double mag = Math.Sqrt(v.x * v.x + v.y * v.y + v.z * v.z); LSL_Types.Vector3 nor = new LSL_Types.Vector3(); nor.x = v.x / mag; nor.y = v.y / mag; -- cgit v1.1