diff options
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs b/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs index 8d7d3b3..fa2ed3e 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs | |||
@@ -172,8 +172,13 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
172 | /// <param name="req"></param> | 172 | /// <param name="req"></param> |
173 | private void RayCast(ODERayCastRequest req) | 173 | private void RayCast(ODERayCastRequest req) |
174 | { | 174 | { |
175 | // limit ray lenght or collisions will take all avaiable stack space | ||
176 | float len = req.length; | ||
177 | if (len > 250f) | ||
178 | len = 250f; | ||
179 | |||
175 | // Create the ray | 180 | // Create the ray |
176 | IntPtr ray = d.CreateRay(m_scene.space, req.length); | 181 | IntPtr ray = d.CreateRay(m_scene.space, len); |
177 | d.GeomRaySet(ray, req.Origin.X, req.Origin.Y, req.Origin.Z, req.Normal.X, req.Normal.Y, req.Normal.Z); | 182 | d.GeomRaySet(ray, req.Origin.X, req.Origin.Y, req.Origin.Z, req.Normal.X, req.Normal.Y, req.Normal.Z); |
178 | 183 | ||
179 | // Collide test | 184 | // Collide test |
@@ -218,8 +223,13 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
218 | /// <param name="req"></param> | 223 | /// <param name="req"></param> |
219 | private void RayCast(ODERayRequest req) | 224 | private void RayCast(ODERayRequest req) |
220 | { | 225 | { |
226 | // limit ray lenght or collisions will take all avaiable stack space | ||
227 | float len = req.length; | ||
228 | if (len > 250f) | ||
229 | len = 250f; | ||
230 | |||
221 | // Create the ray | 231 | // Create the ray |
222 | IntPtr ray = d.CreateRay(m_scene.space, req.length); | 232 | IntPtr ray = d.CreateRay(m_scene.space, len); |
223 | d.GeomRaySet(ray, req.Origin.X, req.Origin.Y, req.Origin.Z, req.Normal.X, req.Normal.Y, req.Normal.Z); | 233 | d.GeomRaySet(ray, req.Origin.X, req.Origin.Y, req.Origin.Z, req.Normal.X, req.Normal.Y, req.Normal.Z); |
224 | 234 | ||
225 | // Collide test | 235 | // Collide test |