Thanks Ewe Loon for Mantis #3007 - llAngleBetween is producing numbers greater then Pi Radians.

Also modified to use the system constant for Pi and prevent negative results.
0.6.5-rc1
Dahlia Trimble 2009-04-07 07:59:32 +00:00
parent 0d4880d5cf
commit eb190905b5
1 changed files with 4 additions and 1 deletions

View File

@ -4277,7 +4277,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
return (double) Math.Acos(a.x * b.x + a.y * b.y + a.z * b.z + a.s * b.s) * 2; double angle = Math.Acos(a.x * b.x + a.y * b.y + a.z * b.z + a.s * b.s) * 2;
if (angle < 0) angle = -angle;
if (angle > Math.PI) return (Math.PI * 2 - angle);
return angle;
} }
public LSL_String llGetInventoryKey(string name) public LSL_String llGetInventoryKey(string name)