* Bigisn ODE Stability update 2

ThreadPoolClientBranch
Teravus Ovares 2008-02-14 00:39:08 +00:00
parent 3588d89b2c
commit 0d14c47c28
4 changed files with 75 additions and 26 deletions

View File

@ -833,7 +833,7 @@ namespace OpenSim.Region.Communications.OGS1
failures = m_deadRegionCache[regionHandle]; failures = m_deadRegionCache[regionHandle];
} }
} }
if (failures <= 3) if (failures <= 1)
{ {
RegionInfo regInfo = null; RegionInfo regInfo = null;
try try

View File

@ -1282,6 +1282,13 @@ namespace OpenSim.Region.Environment.Scenes
else else
{ {
m_log.Warn("[INTERREGION]: Prim Crossing Failed!"); m_log.Warn("[INTERREGION]: Prim Crossing Failed!");
if (grp.RootPart != null)
{
if (grp.RootPart.PhysActor != null)
{
grp.RootPart.PhysActor.CrossingFailure();
}
}
} }
} }
} }

View File

@ -142,8 +142,7 @@ namespace OpenSim.Region.Physics.OdePlugin
m_taintadd = true; m_taintadd = true;
_parent_scene.AddPhysicsActorTaint(this); _parent_scene.AddPhysicsActorTaint(this);
// don't do .add() here; old geoms get recycled with the same hash // don't do .add() here; old geoms get recycled with the same hash
parent_scene.geom_name_map[prim_geom] = primName;
parent_scene.actor_name_map[prim_geom] = (PhysicsActor) this;
} }
/// <summary> /// <summary>
@ -378,7 +377,7 @@ namespace OpenSim.Region.Physics.OdePlugin
public void ProcessTaints(float timestep) public void ProcessTaints(float timestep)
{ {
System.Threading.Thread.Sleep(5);
if (m_taintadd) if (m_taintadd)
changeadd(timestep); changeadd(timestep);
@ -412,7 +411,26 @@ namespace OpenSim.Region.Physics.OdePlugin
changevelocity(timestep); changevelocity(timestep);
} }
public void ResetTaints()
{
m_taintposition = _position;
m_taintrot = _orientation;
m_taintPhysics = m_isphysical;
m_taintsize = _size;
m_taintshape = false;
m_taintforce = false;
m_taintdisable = false;
m_taintVelocity = PhysicsVector.Zero;
}
public void changeadd(float timestep) public void changeadd(float timestep)
{ {
if (_mesh != null) if (_mesh != null)
@ -526,6 +544,8 @@ namespace OpenSim.Region.Physics.OdePlugin
} }
_parent_scene.geom_name_map[prim_geom] = this.m_primName;
_parent_scene.actor_name_map[prim_geom] = (PhysicsActor)this;
m_taintadd = false; m_taintadd = false;
@ -610,8 +630,14 @@ namespace OpenSim.Region.Physics.OdePlugin
public void changesize(float timestamp) public void changesize(float timestamp)
{ {
if (!_parent_scene.geom_name_map.ContainsKey(prim_geom))
{
m_taintsize = _size;
return;
}
string oldname = _parent_scene.geom_name_map[prim_geom]; string oldname = _parent_scene.geom_name_map[prim_geom];
// Cleanup of old prim geometry // Cleanup of old prim geometry
if (_mesh != null) if (_mesh != null)
{ {
@ -995,10 +1021,15 @@ namespace OpenSim.Region.Physics.OdePlugin
public override void CrossingFailure() public override void CrossingFailure()
{ {
m_crossingfailures++; m_crossingfailures++;
if (m_crossingfailures >= 5) if (m_crossingfailures > 5)
{
base.RaiseOutOfBounds(_position);
return;
}
else if (m_crossingfailures == 5)
{ {
m_log.Warn("[PHYSICS]: Too many crossing failures for: " + m_primName); m_log.Warn("[PHYSICS]: Too many crossing failures for: " + m_primName);
} }
} }
public void UpdatePositionAndVelocity() public void UpdatePositionAndVelocity()

View File

@ -736,6 +736,7 @@ namespace OpenSim.Region.Physics.OdePlugin
/// <param name="prim"></param> /// <param name="prim"></param>
public void RemovePrimThreadLocked(OdePrim prim) public void RemovePrimThreadLocked(OdePrim prim)
{ {
prim.ResetTaints();
lock (OdeLock) lock (OdeLock)
{ {
System.Threading.Thread.Sleep(20); System.Threading.Thread.Sleep(20);
@ -1237,14 +1238,15 @@ namespace OpenSim.Region.Physics.OdePlugin
actor.Move(timeStep); actor.Move(timeStep);
actor.collidelock = true; actor.collidelock = true;
} }
if (!ode.lockquery())
{
ode.dlock(world); ode.dlock(world);
collision_optimized(timeStep); collision_optimized(timeStep);
ode.dunlock(world);
try try
{ {
@ -1255,13 +1257,20 @@ namespace OpenSim.Region.Physics.OdePlugin
d.WorldQuickStep(world, 0.001f); d.WorldQuickStep(world, 0.001f);
} }
d.JointGroupEmpty(contactgroup); d.JointGroupEmpty(contactgroup);
ode.dunlock(world);
step_time -= ODE_STEPSIZE;
i++;
}
else
{
fps = 0;
}
foreach (OdeCharacter actor in _characters) foreach (OdeCharacter actor in _characters)
{ {
actor.collidelock = false; actor.collidelock = false;
} }
step_time -= ODE_STEPSIZE;
i++;
} }
foreach (OdeCharacter actor in _characters) foreach (OdeCharacter actor in _characters)
@ -1274,11 +1283,13 @@ namespace OpenSim.Region.Physics.OdePlugin
bool processedtaints = false; bool processedtaints = false;
foreach (OdePrim prim in _taintedPrim) foreach (OdePrim prim in _taintedPrim)
{ {
prim.ProcessTaints(timeStep);
if (prim.m_taintremove) if (prim.m_taintremove)
{ {
RemovePrimThreadLocked(prim); RemovePrimThreadLocked(prim);
} }
prim.ProcessTaints(timeStep);
processedtaints = true; processedtaints = true;
prim.m_collisionscore = 0; prim.m_collisionscore = 0;
} }