From 30d012b29718749351a07891333f68fc183ecc54 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 10 Apr 2009 14:15:47 +0000 Subject: * Apply http://opensimulator.org/mantis/view.php?id=3432 * Make llGroundSlope() return correct results * Thanks aduffy70! --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 0f7d039..0efdd77 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -5464,15 +5464,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api Vector3 p0 = new Vector3(pos.X, pos.Y, (float)llGround( - new LSL_Vector(pos.X, pos.Y, pos.Z) + new LSL_Vector(offset.x, offset.y, offset.z) )); Vector3 p1 = new Vector3(pos.X + 1, pos.Y, (float)llGround( - new LSL_Vector(pos.X + 1, pos.Y, pos.Z) + new LSL_Vector(offset.x + 1, offset.y, offset.z) )); Vector3 p2 = new Vector3(pos.X, pos.Y + 1, (float)llGround( - new LSL_Vector(pos.X, pos.Y + 1, pos.Z) + new LSL_Vector(offset.x, offset.y + 1, offset.z) )); Vector3 v0 = new Vector3(p1.X - p0.X, p1.Y - p0.Y, p1.Z - p0.Z); @@ -5485,6 +5485,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api tv.X = (v0.Y * v1.Z) - (v0.Z * v1.Y); tv.Y = (v0.Z * v1.X) - (v0.X * v1.Z); tv.Z = (v0.X * v1.Y) - (v0.Y * v1.X); + if ((tv.X == 0) && (tv.Y == 0)) + tv.Z = 0; return new LSL_Vector(tv.X, tv.Y, tv.Z); } -- cgit v1.1