aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
authorUbitUmarov2016-11-06 04:29:01 +0000
committerUbitUmarov2016-11-06 04:29:01 +0000
commit6956ada5e83d1d1ebcedef6c6154925e8efd501d (patch)
tree92e070787c2d77efbbacfa1e5f268d197e899a57 /OpenSim/Region/ScriptEngine/Shared
parentrestrict ubOde castray with terrain range only on horizontal plane, let it fi... (diff)
downloadopensim-SC-6956ada5e83d1d1ebcedef6c6154925e8efd501d.zip
opensim-SC-6956ada5e83d1d1ebcedef6c6154925e8efd501d.tar.gz
opensim-SC-6956ada5e83d1d1ebcedef6c6154925e8efd501d.tar.bz2
opensim-SC-6956ada5e83d1d1ebcedef6c6154925e8efd501d.tar.xz
oops bug fix
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs48
1 files changed, 29 insertions, 19 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 33d5757..1a73c3e 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -14519,7 +14519,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
14519 Vector3 rayEnd = end; 14519 Vector3 rayEnd = end;
14520 Vector3 dir = rayEnd - rayStart; 14520 Vector3 dir = rayEnd - rayStart;
14521 14521
14522 float dist = Vector3.Mag(dir); 14522 float dist = dir.Length();
14523 14523
14524 int count = 1; 14524 int count = 1;
14525 bool detectPhantom = false; 14525 bool detectPhantom = false;
@@ -14581,14 +14581,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
14581 object physresults; 14581 object physresults;
14582 physresults = World.RayCastFiltered(rayStart, direction, dist, physcount, rayfilter); 14582 physresults = World.RayCastFiltered(rayStart, direction, dist, physcount, rayfilter);
14583 14583
14584/*
14585 if (physresults == null) 14584 if (physresults == null)
14586 { 14585 {
14587 list.Add(new LSL_Integer(-3)); // timeout error 14586// list.Add(new LSL_Integer(-3)); // timeout error
14588 return list; 14587// return list;
14588 results = new List<ContactResult>();
14589 } 14589 }
14590*/ 14590 else
14591 results = (List<ContactResult>)physresults; 14591 results = (List<ContactResult>)physresults;
14592 14592
14593 // for now physics doesn't detect sitted avatars so do it outside physics 14593 // for now physics doesn't detect sitted avatars so do it outside physics
14594 if (checkAgents) 14594 if (checkAgents)
@@ -14609,6 +14609,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
14609 foreach (ContactResult r in objectHits) 14609 foreach (ContactResult r in objectHits)
14610 results.Add(r); 14610 results.Add(r);
14611 } 14611 }
14612 // Double check this because of current ODE distance problems
14613 if (checkTerrain && dist > 60)
14614 {
14615 bool skipGroundCheck = false;
14616
14617 foreach (ContactResult c in results)
14618 {
14619 if (c.ConsumerID == 0) // Physics gave us a ground collision
14620 skipGroundCheck = true;
14621 }
14622
14623 if (!skipGroundCheck)
14624 {
14625 float tmp = dir.X * dir.X + dir.Y * dir.Y;
14626 if(tmp > 2500)
14627 {
14628 ContactResult? groundContact = GroundIntersection(rayStart, rayEnd);
14629 if (groundContact != null)
14630 results.Add((ContactResult)groundContact);
14631 }
14632 }
14633 }
14612 } 14634 }
14613 else 14635 else
14614 { 14636 {
@@ -14629,20 +14651,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
14629 results.Add(objectHits[iter]); 14651 results.Add(objectHits[iter]);
14630 } 14652 }
14631 } 14653 }
14632 }
14633
14634 // Double check this
14635 if (checkTerrain)
14636 {
14637 bool skipGroundCheck = false;
14638
14639 foreach (ContactResult c in results)
14640 {
14641 if (c.ConsumerID == 0) // Physics gave us a ground collision
14642 skipGroundCheck = true;
14643 }
14644 14654
14645 if (!skipGroundCheck) 14655 if (checkTerrain)
14646 { 14656 {
14647 ContactResult? groundContact = GroundIntersection(rayStart, rayEnd); 14657 ContactResult? groundContact = GroundIntersection(rayStart, rayEnd);
14648 if (groundContact != null) 14658 if (groundContact != null)