Fix hit testing link sets properly. Fix raycasting for LSL.

This commit is contained in:
Melanie
2011-12-17 12:31:25 +01:00
parent 69f29cb53e
commit 8a9a8ed5c9
4 changed files with 345 additions and 106 deletions

View File

@@ -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;