From 0d14c47c28f4e453540f5f6807ba8b86d5ff50c2 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Thu, 14 Feb 2008 00:39:08 +0000 Subject: * Bigisn ODE Stability update 2 --- OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 43 +++++++++++++++++++++++++---- 1 file changed, 37 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 527a5cc..ececa6c 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs @@ -142,8 +142,7 @@ namespace OpenSim.Region.Physics.OdePlugin m_taintadd = true; _parent_scene.AddPhysicsActorTaint(this); // 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; + } /// @@ -378,7 +377,7 @@ namespace OpenSim.Region.Physics.OdePlugin public void ProcessTaints(float timestep) { - System.Threading.Thread.Sleep(5); + if (m_taintadd) changeadd(timestep); @@ -412,7 +411,26 @@ namespace OpenSim.Region.Physics.OdePlugin 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) { if (_mesh != null) @@ -525,7 +543,9 @@ 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; @@ -610,8 +630,14 @@ namespace OpenSim.Region.Physics.OdePlugin 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]; + // Cleanup of old prim geometry if (_mesh != null) { @@ -995,11 +1021,16 @@ namespace OpenSim.Region.Physics.OdePlugin public override void CrossingFailure() { m_crossingfailures++; - if (m_crossingfailures >= 5) + if (m_crossingfailures > 5) { - m_log.Warn("[PHYSICS]: Too many crossing failures for: " + m_primName); + base.RaiseOutOfBounds(_position); + return; } + else if (m_crossingfailures == 5) + { + m_log.Warn("[PHYSICS]: Too many crossing failures for: " + m_primName); + } } public void UpdatePositionAndVelocity() { -- cgit v1.1