From 8a9a8ed5c903f3f685dfff2fd81a2c9594a12584 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 17 Dec 2011 12:31:25 +0100 Subject: Fix hit testing link sets properly. Fix raycasting for LSL. --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 67eafd5..09cbbfe 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -789,6 +789,10 @@ namespace OpenSim.Region.Framework.Scenes EntityIntersection result = new EntityIntersection(); SceneObjectPart[] parts = m_parts.GetArray(); + + // Find closest hit here + float idist = float.MaxValue; + for (int i = 0; i < parts.Length; i++) { SceneObjectPart part = parts[i]; @@ -803,11 +807,6 @@ namespace OpenSim.Region.Framework.Scenes EntityIntersection inter = part.TestIntersectionOBB(hRay, parentrotation, frontFacesOnly, faceCenters); - // This may need to be updated to the maximum draw distance possible.. - // We might (and probably will) be checking for prim creation from other sims - // when the camera crosses the border. - float idist = Constants.RegionSize; - if (inter.HitTF) { // We need to find the closest prim to return to the testcaller along the ray @@ -818,8 +817,9 @@ namespace OpenSim.Region.Framework.Scenes result.obj = part; result.normal = inter.normal; result.distance = inter.distance; + + idist = inter.distance; } - } } return result; -- cgit v1.1