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/Manager/PhysicsActor.cs | 35 ++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Physics/Manager/PhysicsActor.cs') diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index f48f129..046c285 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs @@ -51,9 +51,9 @@ namespace OpenSim.Region.Physics.Manager public int m_colliderType; public int m_GenericStartEnd; //public uint m_LocalID; - public List m_objCollisionList; + public Dictionary m_objCollisionList = new Dictionary(); - public CollisionEventUpdate(uint localID, int colliderType, int GenericStartEnd, List objCollisionList) + public CollisionEventUpdate(uint localID, int colliderType, int GenericStartEnd, Dictionary objCollisionList) { m_colliderType = colliderType; m_GenericStartEnd = GenericStartEnd; @@ -64,7 +64,8 @@ namespace OpenSim.Region.Physics.Manager { m_colliderType = (int) ActorTypes.Unknown; m_GenericStartEnd = 1; - m_objCollisionList = null; + // m_objCollisionList = null; + m_objCollisionList = new Dictionary(); } public int collidertype @@ -79,9 +80,17 @@ namespace OpenSim.Region.Physics.Manager set { m_GenericStartEnd = value; } } - public void addCollider(uint localID) + public void addCollider(uint localID, float depth) { - m_objCollisionList.Add(localID); + if (!m_objCollisionList.ContainsKey(localID)) + { + m_objCollisionList.Add(localID, depth); + } + else + { + if (m_objCollisionList[localID] < depth) + m_objCollisionList[localID] = depth; + } } } @@ -189,6 +198,9 @@ namespace OpenSim.Region.Physics.Manager public abstract void AddForce(PhysicsVector force); public abstract void SetMomentum(PhysicsVector momentum); + public abstract void SubscribeEvents(int ms); + public abstract void UnSubscribeEvents(); + public abstract bool SubscribedEvents(); } public class NullPhysicsActor : PhysicsActor @@ -370,5 +382,18 @@ namespace OpenSim.Region.Physics.Manager public override void SetMomentum(PhysicsVector momentum) { } + + public override void SubscribeEvents(int ms) + { + + } + public override void UnSubscribeEvents() + { + + } + public override bool SubscribedEvents() + { + return false; + } } } -- cgit v1.1