aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs38
1 files changed, 38 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 474d434..45581c5 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -353,6 +353,44 @@ namespace OpenSim.Region.Environment.Scenes
353 } 353 }
354 } 354 }
355 355
356 public EntityIntersection testIntersection(Ray hRay)
357 {
358 EntityIntersection returnresult = new EntityIntersection();
359 bool gothit = false;
360 foreach (SceneObjectPart part in m_parts.Values)
361 {
362 SceneObjectPart returnThisPart = null;
363 Vector3 partPosition = new Vector3(part.AbsolutePosition.X,part.AbsolutePosition.Y,part.AbsolutePosition.Z);
364 Quaternion parentrotation = new Quaternion(GroupRotation.W,GroupRotation.X,GroupRotation.Y,GroupRotation.Z);
365 EntityIntersection inter = part.testIntersection(hRay,parentrotation);
366
367 float idist = 256f;
368
369
370
371
372 if (inter.HitTF) {
373 // We need to find the closest prim to return to the testcaller along the ray
374 if (inter.distance < idist) {
375
376 idist = inter.distance;
377 returnresult.HitTF = true;
378 returnresult.ipoint = inter.ipoint;
379 returnresult.obj = part;
380 returnresult.normal = inter.normal;
381 returnresult.distance = inter.distance;
382 gothit = true;
383 }
384 }
385
386
387 }
388 return returnresult;
389
390 }
391
392
393
356 /// <summary> 394 /// <summary>
357 /// 395 ///
358 /// </summary> 396 /// </summary>