From 014cd1ab428feff96484c666694c33822344269e Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 6 Nov 2016 03:53:12 +0000 Subject: restrict ubOde castray with terrain range only on horizontal plane, let it find physical avatars. --- .../Region/PhysicsModules/ubOde/ODERayCastRequestManager.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/PhysicsModules/ubOde/ODERayCastRequestManager.cs') diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODERayCastRequestManager.cs b/OpenSim/Region/PhysicsModules/ubOde/ODERayCastRequestManager.cs index b82d593..adefd5e 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODERayCastRequestManager.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODERayCastRequestManager.cs @@ -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); } -- cgit v1.1