mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
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.
This commit is contained in:
@@ -4277,7 +4277,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
{
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user