For ScenePresence collision events, instead of creating a new CollisionEventsThisFrame every time we need to send some new ones, reuse the existing one instead.

This assumes that the listener is using the data synchronously, which is currently the case.
0.7.2-post-fixes
Justin Clark-Casey (justincc) 2011-10-25 22:19:17 +01:00
parent 057b78bfbe
commit 871f1d0ae7
3 changed files with 17 additions and 9 deletions

View File

@ -2248,6 +2248,7 @@ namespace OpenSim.Region.Framework.Scenes
});
}
}
if (colliding.Count > 0)
{
StartCollidingMessage.Colliders = colliding;
@ -2255,10 +2256,11 @@ namespace OpenSim.Region.Framework.Scenes
if (m_parentGroup.Scene == null)
return;
if (m_parentGroup.PassCollision == true)
{
//TODO: Add pass to root prim!
}
// if (m_parentGroup.PassCollision == true)
// {
// //TODO: Add pass to root prim!
// }
m_parentGroup.Scene.EventManager.TriggerScriptCollidingStart(LocalId, StartCollidingMessage);
}
}

View File

@ -113,6 +113,14 @@ namespace OpenSim.Region.Physics.Manager
m_objCollisionList[localID] = contact;
}
}
/// <summary>
/// Clear added collision events.
/// </summary>
public void Clear()
{
m_objCollisionList.Clear();
}
}
public abstract class PhysicsActor

View File

@ -1235,11 +1235,9 @@ namespace OpenSim.Region.Physics.OdePlugin
{
if (m_eventsubscription > m_requestedUpdateFrequency)
{
if (CollisionEventsThisFrame != null)
{
base.SendCollisionUpdate(CollisionEventsThisFrame);
}
CollisionEventsThisFrame = new CollisionEventUpdate();
base.SendCollisionUpdate(CollisionEventsThisFrame);
CollisionEventsThisFrame.Clear();
m_eventsubscription = 0;
}
}