diff options
Diffstat (limited to 'OpenSim/Region/PhysicsModules/Ode/ODERayCastRequestManager.cs')
-rw-r--r-- | OpenSim/Region/PhysicsModules/Ode/ODERayCastRequestManager.cs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/OpenSim/Region/PhysicsModules/Ode/ODERayCastRequestManager.cs b/OpenSim/Region/PhysicsModules/Ode/ODERayCastRequestManager.cs index 8d610f7..6199387 100644 --- a/OpenSim/Region/PhysicsModules/Ode/ODERayCastRequestManager.cs +++ b/OpenSim/Region/PhysicsModules/Ode/ODERayCastRequestManager.cs | |||
@@ -180,7 +180,7 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
180 | len = 250f; | 180 | len = 250f; |
181 | 181 | ||
182 | // Create the ray | 182 | // Create the ray |
183 | IntPtr ray = d.CreateRay(m_scene.space, req.length); | 183 | IntPtr ray = d.CreateRay(m_scene.space, len); |
184 | d.GeomRaySet(ray, req.Origin.X, req.Origin.Y, req.Origin.Z, req.Normal.X, req.Normal.Y, req.Normal.Z); | 184 | d.GeomRaySet(ray, req.Origin.X, req.Origin.Y, req.Origin.Z, req.Normal.X, req.Normal.Y, req.Normal.Z); |
185 | 185 | ||
186 | // Collide test | 186 | // Collide test |
@@ -225,8 +225,13 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
225 | /// <param name="req"></param> | 225 | /// <param name="req"></param> |
226 | private void RayCast(ODERayRequest req) | 226 | private void RayCast(ODERayRequest req) |
227 | { | 227 | { |
228 | // limit ray length or collisions will take all avaiable stack space | ||
229 | float len = req.length; | ||
230 | if (len > 250f) | ||
231 | len = 250f; | ||
232 | |||
228 | // Create the ray | 233 | // Create the ray |
229 | IntPtr ray = d.CreateRay(m_scene.space, req.length); | 234 | IntPtr ray = d.CreateRay(m_scene.space, len); |
230 | d.GeomRaySet(ray, req.Origin.X, req.Origin.Y, req.Origin.Z, req.Normal.X, req.Normal.Y, req.Normal.Z); | 235 | d.GeomRaySet(ray, req.Origin.X, req.Origin.Y, req.Origin.Z, req.Normal.X, req.Normal.Y, req.Normal.Z); |
231 | 236 | ||
232 | // Collide test | 237 | // Collide test |
@@ -438,4 +443,4 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
438 | public float length; | 443 | public float length; |
439 | public RayCallback callbackMethod; | 444 | public RayCallback callbackMethod; |
440 | } | 445 | } |
441 | } \ No newline at end of file | 446 | } |