aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2013-01-23 20:58:47 +0100
committerMelanie2013-01-23 20:58:47 +0100
commitdd6ddcc7a53565cc540def336c5b4bd2307a1d63 (patch)
tree56494e19d8652ab54620ca7a30eafee65ac96678
parentFix a type (Suports => Supports). Also put the normal terrain collision check (diff)
downloadopensim-SC_OLD-dd6ddcc7a53565cc540def336c5b4bd2307a1d63.zip
opensim-SC_OLD-dd6ddcc7a53565cc540def336c5b4bd2307a1d63.tar.gz
opensim-SC_OLD-dd6ddcc7a53565cc540def336c5b4bd2307a1d63.tar.bz2
opensim-SC_OLD-dd6ddcc7a53565cc540def336c5b4bd2307a1d63.tar.xz
Prevent double ground collisions and prefer the physics result if there is one.
ODE is known to not see the ground sometimes on raycast so the double test is needed.
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs18
1 files changed, 15 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 703c54d..a8763ea 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -12287,11 +12287,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
12287 } 12287 }
12288 } 12288 }
12289 12289
12290 // Double check this
12290 if (checkTerrain) 12291 if (checkTerrain)
12291 { 12292 {
12292 ContactResult? groundContact = GroundIntersection(rayStart, rayEnd); 12293 bool skipGroundCheck = false;
12293 if (groundContact != null) 12294
12294 results.Add((ContactResult)groundContact); 12295 foreach (ContactResult c in results)
12296 {
12297 if (c.ConsumerID == 0) // Physics gave us a ground collision
12298 skipGroundCheck = true;
12299 }
12300
12301 if (!skipGroundCheck)
12302 {
12303 ContactResult? groundContact = GroundIntersection(rayStart, rayEnd);
12304 if (groundContact != null)
12305 results.Add((ContactResult)groundContact);
12306 }
12295 } 12307 }
12296 12308
12297 results.Sort(delegate(ContactResult a, ContactResult b) 12309 results.Sort(delegate(ContactResult a, ContactResult b)