aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs')
-rw-r--r--OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs41
1 files changed, 29 insertions, 12 deletions
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs
index 6e9281b..7fe3109 100644
--- a/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs
+++ b/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs
@@ -173,8 +173,13 @@ namespace OpenSim.Region.Physics.OdePlugin
173 d.GeomRaySetClosestHit(ray, closestHit); 173 d.GeomRaySetClosestHit(ray, closestHit);
174 174
175 if (req.callbackMethod is RaycastCallback) 175 if (req.callbackMethod is RaycastCallback)
176 {
176 // if we only want one get only one per Collision pair saving memory 177 // if we only want one get only one per Collision pair saving memory
177 CurrentRayFilter |= RayFilterFlags.ClosestHit; 178 CurrentRayFilter |= RayFilterFlags.ClosestHit;
179 d.GeomRaySetClosestHit(ray, 1);
180 }
181 else
182 d.GeomRaySetClosestHit(ray, closestHit);
178 } 183 }
179 184
180 if ((CurrentRayFilter & RayFilterFlags.ContactsUnImportant) != 0) 185 if ((CurrentRayFilter & RayFilterFlags.ContactsUnImportant) != 0)
@@ -555,10 +560,13 @@ namespace OpenSim.Region.Physics.OdePlugin
555 560
556 ContactResult collisionresult = new ContactResult(); 561 ContactResult collisionresult = new ContactResult();
557 collisionresult.ConsumerID = ID; 562 collisionresult.ConsumerID = ID;
558 collisionresult.Pos = new Vector3(curcontact.pos.X, curcontact.pos.Y, curcontact.pos.Z); 563 collisionresult.Pos.X = curcontact.pos.X;
564 collisionresult.Pos.Y = curcontact.pos.Y;
565 collisionresult.Pos.Z = curcontact.pos.Z;
559 collisionresult.Depth = curcontact.depth; 566 collisionresult.Depth = curcontact.depth;
560 collisionresult.Normal = new Vector3(curcontact.normal.X, curcontact.normal.Y, 567 collisionresult.Normal.X = curcontact.normal.X;
561 curcontact.normal.Z); 568 collisionresult.Normal.Y = curcontact.normal.Y;
569 collisionresult.Normal.Z = curcontact.normal.Z;
562 lock (m_contactResults) 570 lock (m_contactResults)
563 { 571 {
564 m_contactResults.Add(collisionresult); 572 m_contactResults.Add(collisionresult);
@@ -581,10 +589,13 @@ namespace OpenSim.Region.Physics.OdePlugin
581 589
582 if (curcontact.depth < collisionresult.Depth) 590 if (curcontact.depth < collisionresult.Depth)
583 { 591 {
584 collisionresult.Pos = new Vector3(curcontact.pos.X, curcontact.pos.Y, curcontact.pos.Z); 592 collisionresult.Pos.X = curcontact.pos.X;
593 collisionresult.Pos.Y = curcontact.pos.Y;
594 collisionresult.Pos.Z = curcontact.pos.Z;
585 collisionresult.Depth = curcontact.depth; 595 collisionresult.Depth = curcontact.depth;
586 collisionresult.Normal = new Vector3(curcontact.normal.X, curcontact.normal.Y, 596 collisionresult.Normal.X = curcontact.normal.X;
587 curcontact.normal.Z); 597 collisionresult.Normal.Y = curcontact.normal.Y;
598 collisionresult.Normal.Z = curcontact.normal.Z;
588 } 599 }
589 } 600 }
590 601
@@ -699,10 +710,13 @@ namespace OpenSim.Region.Physics.OdePlugin
699 710
700 ContactResult collisionresult = new ContactResult(); 711 ContactResult collisionresult = new ContactResult();
701 collisionresult.ConsumerID = ID; 712 collisionresult.ConsumerID = ID;
702 collisionresult.Pos = new Vector3(curcontact.pos.X, curcontact.pos.Y, curcontact.pos.Z); 713 collisionresult.Pos.X = curcontact.pos.X;
714 collisionresult.Pos.Y = curcontact.pos.Y;
715 collisionresult.Pos.Z = curcontact.pos.Z;
703 collisionresult.Depth = curcontact.depth; 716 collisionresult.Depth = curcontact.depth;
704 collisionresult.Normal = new Vector3(curcontact.normal.X, curcontact.normal.Y, 717 collisionresult.Normal.X = curcontact.normal.X;
705 curcontact.normal.Z); 718 collisionresult.Normal.Y = curcontact.normal.Y;
719 collisionresult.Normal.Z = curcontact.normal.Z;
706 lock (m_contactResults) 720 lock (m_contactResults)
707 { 721 {
708 m_contactResults.Add(collisionresult); 722 m_contactResults.Add(collisionresult);
@@ -725,10 +739,13 @@ namespace OpenSim.Region.Physics.OdePlugin
725 739
726 if (curcontact.depth < collisionresult.Depth) 740 if (curcontact.depth < collisionresult.Depth)
727 { 741 {
728 collisionresult.Pos = new Vector3(curcontact.pos.X, curcontact.pos.Y, curcontact.pos.Z); 742 collisionresult.Pos.X = curcontact.pos.X;
743 collisionresult.Pos.Y = curcontact.pos.Y;
744 collisionresult.Pos.Z = curcontact.pos.Z;
729 collisionresult.Depth = curcontact.depth; 745 collisionresult.Depth = curcontact.depth;
730 collisionresult.Normal = new Vector3(curcontact.normal.X, curcontact.normal.Y, 746 collisionresult.Normal.X = curcontact.normal.X;
731 curcontact.normal.Z); 747 collisionresult.Normal.Y = curcontact.normal.Y;
748 collisionresult.Normal.Z = curcontact.normal.Z;
732 } 749 }
733 } 750 }
734 751