aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneGraph.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneGraph.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs17
1 files changed, 7 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 7a45e3b..3bd079a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -928,25 +928,22 @@ namespace OpenSim.Region.Framework.Scenes
928 { 928 {
929 // Primitive Ray Tracing 929 // Primitive Ray Tracing
930 float closestDistance = 280f; 930 float closestDistance = 280f;
931 EntityIntersection returnResult = new EntityIntersection(); 931 EntityIntersection result = new EntityIntersection();
932 List<EntityBase> EntityList = GetEntities(); 932 List<EntityBase> EntityList = GetEntities();
933 foreach (EntityBase ent in EntityList) 933 foreach (EntityBase ent in EntityList)
934 { 934 {
935 if (ent is SceneObjectGroup) 935 if (ent is SceneObjectGroup)
936 { 936 {
937 SceneObjectGroup reportingG = (SceneObjectGroup)ent; 937 SceneObjectGroup reportingG = (SceneObjectGroup)ent;
938 EntityIntersection result = reportingG.TestIntersection(hray, frontFacesOnly, faceCenters); 938 EntityIntersection inter = reportingG.TestIntersection(hray, frontFacesOnly, faceCenters);
939 if (result.HitTF) 939 if (inter.HitTF && inter.distance < closestDistance)
940 { 940 {
941 if (result.distance < closestDistance) 941 closestDistance = inter.distance;
942 { 942 result = inter;
943 closestDistance = result.distance;
944 returnResult = result;
945 }
946 } 943 }
947 } 944 }
948 } 945 }
949 return returnResult; 946 return result;
950 } 947 }
951 948
952 /// <summary> 949 /// <summary>
@@ -979,7 +976,7 @@ namespace OpenSim.Region.Framework.Scenes
979 { 976 {
980 foreach (SceneObjectPart p in ((SceneObjectGroup) ent).GetParts()) 977 foreach (SceneObjectPart p in ((SceneObjectGroup) ent).GetParts())
981 { 978 {
982 if (p.Name==name) 979 if (p.Name == name)
983 { 980 {
984 return p; 981 return p;
985 } 982 }