From 903fbd1f06b990141a90b539a2dbe77ab6be830e Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 18 Sep 2008 18:50:39 +0000 Subject: XEngine: fix collisions, add event coalescing for collision events. Fix a nasty concurrency issue that could cause a high event frequency to start more than one thread pool job for a single script. --- OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/Physics/OdePlugin/ODEPrim.cs') diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index 21e514b..79c4041 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs @@ -2294,14 +2294,12 @@ namespace OpenSim.Region.Physics.OdePlugin if (CollisionEventsThisFrame == null) return; - //if (CollisionEventsThisFrame.m_objCollisionList == null) - // return; + base.SendCollisionUpdate(CollisionEventsThisFrame); - if (CollisionEventsThisFrame.m_objCollisionList.Count > 0) - { - base.SendCollisionUpdate(CollisionEventsThisFrame); + if(CollisionEventsThisFrame.m_objCollisionList.Count == 0) + CollisionEventsThisFrame = null; + else CollisionEventsThisFrame = new CollisionEventUpdate(); - } } public override bool SubscribedEvents() -- cgit v1.1