mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 17:32:42 +08:00
use a more efficient dictionary in OdeScene._collisionEventPrim rather than a list
This commit is contained in:
@@ -221,7 +221,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A list of actors that should receive collision events.
|
/// A list of actors that should receive collision events.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly List<PhysicsActor> _collisionEventPrim = new List<PhysicsActor>();
|
private readonly Dictionary<uint, PhysicsActor> _collisionEventPrim = new Dictionary<uint, PhysicsActor>();
|
||||||
|
|
||||||
private readonly HashSet<OdeCharacter> _badCharacter = new HashSet<OdeCharacter>();
|
private readonly HashSet<OdeCharacter> _badCharacter = new HashSet<OdeCharacter>();
|
||||||
public Dictionary<IntPtr, String> geom_name_map = new Dictionary<IntPtr, String>();
|
public Dictionary<IntPtr, String> geom_name_map = new Dictionary<IntPtr, String>();
|
||||||
@@ -1636,10 +1636,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||||||
// m_log.DebugFormat("[PHYSICS]: Adding {0} to collision event reporting", obj.SOPName);
|
// m_log.DebugFormat("[PHYSICS]: Adding {0} to collision event reporting", obj.SOPName);
|
||||||
|
|
||||||
lock (_collisionEventPrim)
|
lock (_collisionEventPrim)
|
||||||
{
|
_collisionEventPrim[obj.LocalID] = obj;
|
||||||
if (!_collisionEventPrim.Contains(obj))
|
|
||||||
_collisionEventPrim.Add(obj);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -1651,7 +1648,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||||||
// m_log.DebugFormat("[PHYSICS]: Removing {0} from collision event reporting", obj.SOPName);
|
// m_log.DebugFormat("[PHYSICS]: Removing {0} from collision event reporting", obj.SOPName);
|
||||||
|
|
||||||
lock (_collisionEventPrim)
|
lock (_collisionEventPrim)
|
||||||
_collisionEventPrim.Remove(obj);
|
_collisionEventPrim.Remove(obj.LocalID);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Add/Remove Entities
|
#region Add/Remove Entities
|
||||||
@@ -2792,7 +2789,7 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name);
|
|||||||
|
|
||||||
lock (_collisionEventPrim)
|
lock (_collisionEventPrim)
|
||||||
{
|
{
|
||||||
foreach (PhysicsActor obj in _collisionEventPrim)
|
foreach (PhysicsActor obj in _collisionEventPrim.Values)
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat("[PHYSICS]: Assessing {0} for collision events", obj.SOPName);
|
// m_log.DebugFormat("[PHYSICS]: Assessing {0} for collision events", obj.SOPName);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user