From 62df82b74d0f3599585f7320aeab8c6a8262f61f Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 15 Jul 2012 00:50:00 +0100 Subject: messing around... Let terrain and water have nullphysicsactors, let nullphyscisactors have a type water, ground or unknown (default). having this removed geom to name mapping no longer needed. Made some more methods comum to prims and characters acessible via PhysActor allowing for a more uniform access. ... --- .../UbitOdePlugin/ODERayCastRequestManager.cs | 99 +++++++++++++--------- 1 file changed, 60 insertions(+), 39 deletions(-) (limited to 'OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs') diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs index 3d108f8..21fe9c0 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs @@ -470,56 +470,77 @@ namespace OpenSim.Region.Physics.OdePlugin if (p2 == null) { - string name; - - if (!m_scene.geom_name_map.TryGetValue(g2, out name)) - return; - - if (name == "Terrain") - { - // land colision - if ((CurrentRayFilter & RayFilterFlags.land) == 0) - return; - } - else if (name == "Water") - { - if ((CurrentRayFilter & RayFilterFlags.water) == 0) - return; - } - else - return; + /* + string name; + + if (!m_scene.geom_name_map.TryGetValue(g2, out name)) + return; + + if (name == "Terrain") + { + // land colision + if ((CurrentRayFilter & RayFilterFlags.land) == 0) + return; + } + else if (name == "Water") + { + if ((CurrentRayFilter & RayFilterFlags.water) == 0) + return; + } + else + return; + */ + return; } else { - if (p2 is OdePrim) + switch (p2.PhysicsActorType) { - RayFilterFlags thisFlags; + case (int)ActorTypes.Prim: - if (p2.IsPhysical) - thisFlags = RayFilterFlags.physical; - else - thisFlags = RayFilterFlags.nonphysical; + RayFilterFlags thisFlags; - if (p2.Phantom) - thisFlags |= RayFilterFlags.phantom; + if (p2.IsPhysical) + thisFlags = RayFilterFlags.physical; + else + thisFlags = RayFilterFlags.nonphysical; - if (p2.IsVolumeDtc) - thisFlags |= RayFilterFlags.volumedtc; + if (p2.Phantom) + thisFlags |= RayFilterFlags.phantom; - if ((thisFlags & CurrentRayFilter) == 0) - return; + if (p2.IsVolumeDtc) + thisFlags |= RayFilterFlags.volumedtc; - ID = ((OdePrim)p2).LocalID; - } - else if (p2 is OdeCharacter) - { - if ((CurrentRayFilter & RayFilterFlags.agent) == 0) + if ((thisFlags & CurrentRayFilter) == 0) + return; + + ID = ((OdePrim)p2).LocalID; + break; + + case (int)ActorTypes.Agent: + + if ((CurrentRayFilter & RayFilterFlags.agent) == 0) + return; + else + ID = ((OdeCharacter)p2).LocalID; + break; + + case (int)ActorTypes.Ground: + + if ((CurrentRayFilter & RayFilterFlags.land) == 0) + return; + break; + + case (int)ActorTypes.Water: + + if ((CurrentRayFilter & RayFilterFlags.water) == 0) + return; + break; + + default: return; - else - ID = ((OdeCharacter)p2).LocalID; + break; } - else //?? - return; } d.ContactGeom curcontact = new d.ContactGeom(); -- cgit v1.1