From 82e464cb8c974ffb50cd4a1252e09ee815877d11 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 28 Nov 2015 23:44:53 +0000 Subject: let old ODE trigger collision sounds like ubOde --- OpenSim/Region/PhysicsModules/Ode/ODECharacter.cs | 2 +- OpenSim/Region/PhysicsModules/Ode/OdeScene.cs | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/PhysicsModules/Ode') diff --git a/OpenSim/Region/PhysicsModules/Ode/ODECharacter.cs b/OpenSim/Region/PhysicsModules/Ode/ODECharacter.cs index f535c41..aaf90f2 100644 --- a/OpenSim/Region/PhysicsModules/Ode/ODECharacter.cs +++ b/OpenSim/Region/PhysicsModules/Ode/ODECharacter.cs @@ -279,7 +279,7 @@ namespace OpenSim.Region.PhysicsModule.ODE public override bool IsPhysical { - get { return false; } + get { return m_isPhysical; } set { return; } } diff --git a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs index 7ba2083..e23cca6 100644 --- a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs +++ b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs @@ -1442,9 +1442,28 @@ namespace OpenSim.Region.PhysicsModule.ODE obj2LocalID = 0; //ctype = 0; //cStartStop = 0; - if (!p2.SubscribedEvents() && !p1.SubscribedEvents()) +// if (!p2.SubscribedEvents() && !p1.SubscribedEvents()) +// return; + bool p1events = p1.SubscribedEvents(); + bool p2events = p2.SubscribedEvents(); + + if (p1.IsVolumeDtc) + p2events = false; + if (p2.IsVolumeDtc) + p1events = false; + + if (!p2events && !p1events) return; + Vector3 vel = Vector3.Zero; + if (p2 != null && p2.IsPhysical) + vel = p2.Velocity; + + if (p1 != null && p1.IsPhysical) + vel -= p1.Velocity; + + contact.RelativeSpeed = Vector3.Dot(vel, contact.SurfaceNormal); + switch ((ActorTypes)p2.PhysicsActorType) { case ActorTypes.Agent: -- cgit v1.1