aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs16
1 files changed, 14 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs
index 21fe9c0..06cb302 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 }
@@ -261,6 +261,12 @@ namespace OpenSim.Region.Physics.OdePlugin
261 closestHit = ((CurrentRayFilter & RayFilterFlags.ClosestHit) == 0 ? 0 : 1); 261 closestHit = ((CurrentRayFilter & RayFilterFlags.ClosestHit) == 0 ? 0 : 1);
262 backfacecull = ((CurrentRayFilter & RayFilterFlags.BackFaceCull) == 0 ? 0 : 1); 262 backfacecull = ((CurrentRayFilter & RayFilterFlags.BackFaceCull) == 0 ? 0 : 1);
263 263
264 // current ode land to ray collisions is very bad
265 // so for now limit its range badly
266
267 if (req.length > 30.0f && (CurrentRayFilter & RayFilterFlags.land) != 0)
268 req.length = 30.0f;
269
264 d.GeomRaySetLength(ray, req.length); 270 d.GeomRaySetLength(ray, req.length);
265 d.GeomRaySet(ray, req.Origin.X, req.Origin.Y, req.Origin.Z, req.Normal.X, req.Normal.Y, req.Normal.Z); 271 d.GeomRaySet(ray, req.Origin.X, req.Origin.Y, req.Origin.Z, req.Normal.X, req.Normal.Y, req.Normal.Z);
266 d.GeomRaySetParams(ray, 0, backfacecull); 272 d.GeomRaySetParams(ray, 0, backfacecull);
@@ -288,7 +294,10 @@ namespace OpenSim.Region.Physics.OdePlugin
288 catflags |= CollisionCategories.Water; 294 catflags |= CollisionCategories.Water;
289 295
290 if (catflags != 0) 296 if (catflags != 0)
297 {
298 d.GeomSetCollideBits(ray, (uint)catflags);
291 doSpaceRay(req); 299 doSpaceRay(req);
300 }
292 } 301 }
293 else 302 else
294 { 303 {
@@ -314,7 +323,8 @@ namespace OpenSim.Region.Physics.OdePlugin
314 /// 323 ///
315 324
316 private const RayFilterFlags FilterActiveSpace = RayFilterFlags.agent | RayFilterFlags.physical | RayFilterFlags.LSLPhanton; 325 private const RayFilterFlags FilterActiveSpace = RayFilterFlags.agent | RayFilterFlags.physical | RayFilterFlags.LSLPhanton;
317 private const RayFilterFlags FilterStaticSpace = RayFilterFlags.water | RayFilterFlags.land | RayFilterFlags.nonphysical | RayFilterFlags.LSLPhanton; 326// private const RayFilterFlags FilterStaticSpace = RayFilterFlags.water | RayFilterFlags.land | RayFilterFlags.nonphysical | RayFilterFlags.LSLPhanton;
327 private const RayFilterFlags FilterStaticSpace = RayFilterFlags.water | RayFilterFlags.nonphysical | RayFilterFlags.LSLPhanton;
318 328
319 private void doSpaceRay(ODERayRequest req) 329 private void doSpaceRay(ODERayRequest req)
320 { 330 {
@@ -323,6 +333,8 @@ namespace OpenSim.Region.Physics.OdePlugin
323 d.SpaceCollide2(ray, m_scene.ActiveSpace, IntPtr.Zero, nearCallback); 333 d.SpaceCollide2(ray, m_scene.ActiveSpace, IntPtr.Zero, nearCallback);
324 if ((CurrentRayFilter & FilterStaticSpace) != 0 && (m_contactResults.Count < CurrentMaxCount)) 334 if ((CurrentRayFilter & FilterStaticSpace) != 0 && (m_contactResults.Count < CurrentMaxCount))
325 d.SpaceCollide2(ray, m_scene.StaticSpace, IntPtr.Zero, nearCallback); 335 d.SpaceCollide2(ray, m_scene.StaticSpace, IntPtr.Zero, nearCallback);
336 if ((CurrentRayFilter & RayFilterFlags.land) != 0 && (m_contactResults.Count < CurrentMaxCount))
337 d.SpaceCollide2(ray, m_scene.GroundSpace, IntPtr.Zero, nearCallback);
326 338
327 if (req.callbackMethod is RaycastCallback) 339 if (req.callbackMethod is RaycastCallback)
328 { 340 {