remove unnecessary OdeScene._activeprims locking. Code is single-threaded
parent
7480f2fd0e
commit
82dc7886fc
|
@ -194,7 +194,14 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
/// </summary>
|
||||
private readonly HashSet<OdeCharacter> _characters = new HashSet<OdeCharacter>();
|
||||
|
||||
/// <summary>
|
||||
/// Prims in the physics scene.
|
||||
/// </summary>
|
||||
private readonly HashSet<OdePrim> _prims = new HashSet<OdePrim>();
|
||||
|
||||
/// <summary>
|
||||
/// Prims in the physics scene that are subject to physics, not just collisions.
|
||||
/// </summary>
|
||||
private readonly HashSet<OdePrim> _activeprims = new HashSet<OdePrim>();
|
||||
|
||||
/// <summary>
|
||||
|
@ -1565,8 +1572,6 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
//}
|
||||
}
|
||||
|
||||
lock (_activeprims)
|
||||
{
|
||||
List<OdePrim> removeprims = null;
|
||||
foreach (OdePrim chr in _activeprims)
|
||||
{
|
||||
|
@ -1606,7 +1611,6 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -1770,14 +1774,11 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
internal void ActivatePrim(OdePrim prim)
|
||||
{
|
||||
// adds active prim.. (ones that should be iterated over in collisions_optimized
|
||||
lock (_activeprims)
|
||||
{
|
||||
if (!_activeprims.Contains(prim))
|
||||
_activeprims.Add(prim);
|
||||
//else
|
||||
// m_log.Warn("[PHYSICS]: Double Entry in _activeprims detected, potential crash immenent");
|
||||
}
|
||||
}
|
||||
|
||||
public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
|
||||
Vector3 size, Quaternion rotation, bool isPhysical, uint localid)
|
||||
|
@ -2150,7 +2151,6 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
/// <param name="prim"></param>
|
||||
internal void DeactivatePrim(OdePrim prim)
|
||||
{
|
||||
lock (_activeprims)
|
||||
_activeprims.Remove(prim);
|
||||
}
|
||||
|
||||
|
@ -2818,14 +2818,11 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name);
|
|||
}
|
||||
|
||||
// Move other active objects
|
||||
lock (_activeprims)
|
||||
{
|
||||
foreach (OdePrim prim in _activeprims)
|
||||
{
|
||||
prim.m_collisionscore = 0;
|
||||
prim.Move(timeStep);
|
||||
}
|
||||
}
|
||||
|
||||
//if ((framecount % m_randomizeWater) == 0)
|
||||
// randomizeWater(waterlevel);
|
||||
|
@ -2893,10 +2890,8 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name);
|
|||
defects.Clear();
|
||||
}
|
||||
|
||||
lock (_activeprims)
|
||||
{
|
||||
//if (timeStep < 0.2f)
|
||||
{
|
||||
|
||||
foreach (OdePrim prim in _activeprims)
|
||||
{
|
||||
if (prim.IsPhysical && (d.BodyIsEnabled(prim.Body) || !prim._zeroFlag))
|
||||
|
@ -2907,8 +2902,6 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name);
|
|||
SimulateActorPendingJoints(prim);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//DumpJointInfo();
|
||||
|
||||
|
|
Loading…
Reference in New Issue