restrict ubOde castray with terrain range only on horizontal plane, let it find physical avatars.

This commit is contained in:
UbitUmarov
2016-11-06 03:53:12 +00:00
parent d07f48605f
commit 014cd1ab42
2 changed files with 23 additions and 10 deletions

View File

@@ -317,8 +317,17 @@ namespace OpenSim.Region.PhysicsModule.ubOde
// current ode land to ray collisions is very bad
// so for now limit its range badly
if (req.length > 60.0f)
d.GeomRaySetLength(ray, 60.0f);
{
Vector3 t = req.Normal * req.length;
float tmp = t.X * t.X + t.Y * t.Y;
if(tmp > 2500)
{
float tmp2 = req.length * req.length - tmp + 2500;
tmp2 = (float)Math.Sqrt(tmp2);
d.GeomRaySetLength(ray, tmp2);
}
}
d.SpaceCollide2(ray, m_scene.GroundSpace, IntPtr.Zero, nearCallback);
}