From 07167c9a3f6d93fddf66e6f252f4a9b3a4fde8de Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sat, 3 May 2008 04:33:17 +0000 Subject: * Committing some collision stuffs that I'm working on. * Nothing user facing yet. --- OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 31 ++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'OpenSim/Region/Physics/OdePlugin/ODECharacter.cs') diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 9f6b14e..39f94cb 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -112,6 +112,9 @@ namespace OpenSim.Region.Physics.OdePlugin public d.Mass ShellMass; public bool collidelock = false; + public int m_eventsubscription = 0; + private CollisionEventUpdate CollisionEventsThisFrame = null; + public OdeCharacter(String avName, OdeScene parent_scene, PhysicsVector pos, CollisionLocker dode, PhysicsVector size) { ode = dode; @@ -863,5 +866,33 @@ namespace OpenSim.Region.Physics.OdePlugin public override PhysicsVector PIDTarget { set { return; } } public override bool PIDActive { set { return; } } public override float PIDTau { set { return; } } + public override void SubscribeEvents(int ms) + { + m_eventsubscription = ms; + } + public override void UnSubscribeEvents() + { + m_eventsubscription = 0; + } + public void AddCollisionEvent(uint CollidedWith, float depth) + { + if (m_eventsubscription > 0) + CollisionEventsThisFrame.addCollider(CollidedWith,depth); + } + + public void SendCollisions() + { + if (m_eventsubscription > 0) + { + base.SendCollisionUpdate(CollisionEventsThisFrame); + CollisionEventsThisFrame = new CollisionEventUpdate(); + } + } + public override bool SubscribedEvents() + { + if (m_eventsubscription > 0) + return true; + return false; + } } } -- cgit v1.1