mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 20:05:33 +08:00
restrict ubOde castray with terrain range only on horizontal plane, let it find physical avatars.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user