diff options
Diffstat (limited to 'OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs')
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs index 21fe9c0..799a324 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs | |||
@@ -129,7 +129,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
129 | req.length = length; | 129 | req.length = length; |
130 | req.Normal = direction; | 130 | req.Normal = direction; |
131 | req.Origin = position; | 131 | req.Origin = position; |
132 | req.filter = RayFilterFlags.AllPrims; | 132 | req.filter = RayFilterFlags.AllPrims | RayFilterFlags.land; |
133 | 133 | ||
134 | m_PendingRequests.Enqueue(req); | 134 | m_PendingRequests.Enqueue(req); |
135 | } | 135 | } |
@@ -288,7 +288,10 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
288 | catflags |= CollisionCategories.Water; | 288 | catflags |= CollisionCategories.Water; |
289 | 289 | ||
290 | if (catflags != 0) | 290 | if (catflags != 0) |
291 | { | ||
292 | d.GeomSetCollideBits(ray, (uint)catflags); | ||
291 | doSpaceRay(req); | 293 | doSpaceRay(req); |
294 | } | ||
292 | } | 295 | } |
293 | else | 296 | else |
294 | { | 297 | { |
@@ -314,7 +317,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
314 | /// | 317 | /// |
315 | 318 | ||
316 | private const RayFilterFlags FilterActiveSpace = RayFilterFlags.agent | RayFilterFlags.physical | RayFilterFlags.LSLPhanton; | 319 | private const RayFilterFlags FilterActiveSpace = RayFilterFlags.agent | RayFilterFlags.physical | RayFilterFlags.LSLPhanton; |
317 | private const RayFilterFlags FilterStaticSpace = RayFilterFlags.water | RayFilterFlags.land | RayFilterFlags.nonphysical | RayFilterFlags.LSLPhanton; | 320 | // private const RayFilterFlags FilterStaticSpace = RayFilterFlags.water | RayFilterFlags.land | RayFilterFlags.nonphysical | RayFilterFlags.LSLPhanton; |
321 | private const RayFilterFlags FilterStaticSpace = RayFilterFlags.water | RayFilterFlags.nonphysical | RayFilterFlags.LSLPhanton; | ||
318 | 322 | ||
319 | private void doSpaceRay(ODERayRequest req) | 323 | private void doSpaceRay(ODERayRequest req) |
320 | { | 324 | { |
@@ -323,6 +327,16 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
323 | d.SpaceCollide2(ray, m_scene.ActiveSpace, IntPtr.Zero, nearCallback); | 327 | d.SpaceCollide2(ray, m_scene.ActiveSpace, IntPtr.Zero, nearCallback); |
324 | if ((CurrentRayFilter & FilterStaticSpace) != 0 && (m_contactResults.Count < CurrentMaxCount)) | 328 | if ((CurrentRayFilter & FilterStaticSpace) != 0 && (m_contactResults.Count < CurrentMaxCount)) |
325 | d.SpaceCollide2(ray, m_scene.StaticSpace, IntPtr.Zero, nearCallback); | 329 | d.SpaceCollide2(ray, m_scene.StaticSpace, IntPtr.Zero, nearCallback); |
330 | if ((CurrentRayFilter & RayFilterFlags.land) != 0 && (m_contactResults.Count < CurrentMaxCount)) | ||
331 | { | ||
332 | // current ode land to ray collisions is very bad | ||
333 | // so for now limit its range badly | ||
334 | |||
335 | if (req.length > 30.0f) | ||
336 | d.GeomRaySetLength(ray, 30.0f); | ||
337 | |||
338 | d.SpaceCollide2(ray, m_scene.GroundSpace, IntPtr.Zero, nearCallback); | ||
339 | } | ||
326 | 340 | ||
327 | if (req.callbackMethod is RaycastCallback) | 341 | if (req.callbackMethod is RaycastCallback) |
328 | { | 342 | { |