From dfef16297b51fb81550745aeea05bd10cb1fc766 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 7 Jul 2017 01:49:34 +0100 Subject: ubOde don't use old ode body sleep option, a few changes on sleep control, update ode.dll (windows, others needed) (keep older versions.. bc.. well bugs happen) --- OpenSim/Region/PhysicsModules/ubOde/ODEDynamics.cs | 1 + OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs | 36 +++++++++++++++++----- OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | 2 +- 3 files changed, 31 insertions(+), 8 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEDynamics.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEDynamics.cs index 2e6a7db..ce10065 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEDynamics.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEDynamics.cs @@ -345,6 +345,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (rootPrim.Body != IntPtr.Zero && !d.BodyIsEnabled(rootPrim.Body) && !rootPrim.m_isSelected && !rootPrim.m_disabled) d.BodyEnable(rootPrim.Body); + break; case Vehicle.LINEAR_FRICTION_TIMESCALE: if (pValue < m_timestep) pValue = m_timestep; diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs index 4bed0d2..005caee 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs @@ -1847,8 +1847,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde ApplyCollisionCatFlags(); _zeroFlag = true; + d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); d.BodyEnable(Body); - } } resetCollisionAccounting(); @@ -2900,6 +2900,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (Body != IntPtr.Zero && !m_disabled) { _zeroFlag = true; + d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); d.BodyEnable(Body); } } @@ -2933,6 +2934,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (!d.BodyIsEnabled(Body)) { _zeroFlag = true; + d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); d.BodyEnable(Body); } } @@ -2947,6 +2949,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (Body != IntPtr.Zero && !d.BodyIsEnabled(Body)) { _zeroFlag = true; + d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); d.BodyEnable(Body); } } @@ -3012,6 +3015,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (Body != IntPtr.Zero && !d.BodyIsEnabled(Body)) { _zeroFlag = true; + d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); d.BodyEnable(Body); } } @@ -3070,6 +3074,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (Body != IntPtr.Zero && !d.BodyIsEnabled(Body)) { _zeroFlag = true; + d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); d.BodyEnable(Body); } } @@ -3312,8 +3317,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (m_disabled) enableBodySoft(); else if (!d.BodyIsEnabled(Body)) + { + d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); d.BodyEnable(Body); - + } } m_torque = newtorque; } @@ -3323,7 +3330,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde { m_force = force; if (!m_isSelected && !m_outbounds && Body != IntPtr.Zero && !d.BodyIsEnabled(Body)) + { + d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); d.BodyEnable(Body); + } } private void changeAddForce(Vector3 theforce) @@ -3339,7 +3349,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (m_disabled) enableBodySoft(); else if (!d.BodyIsEnabled(Body)) + { + d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); d.BodyEnable(Body); + } } } m_collisionscore = 0; @@ -3359,7 +3372,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (m_disabled) enableBodySoft(); else if (!d.BodyIsEnabled(Body)) + { + d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); d.BodyEnable(Body); + } } } m_collisionscore = 0; @@ -3382,7 +3398,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (m_disabled) enableBodySoft(); else if (!d.BodyIsEnabled(Body)) + { + d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); d.BodyEnable(Body); + } d.BodySetLinearVel(Body, newVel.X, newVel.Y, newVel.Z); } //resetCollisionAccounting(); @@ -3406,7 +3425,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (m_disabled) enableBodySoft(); else if (!d.BodyIsEnabled(Body)) + { + d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); d.BodyEnable(Body); + } d.BodySetAngularVel(Body, newAngVel.X, newAngVel.Y, newAngVel.Z); } //resetCollisionAccounting(); @@ -3571,12 +3593,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde d.BodySetAngularVel(Body,0f,0f,0f); d.BodySetLinearVel(Body,0f,0f,0f); _zeroFlag = true; + d.BodySetAutoDisableSteps(Body, 1); d.BodyEnable(Body); m_bodydisablecontrol = -4; } if(m_bodydisablecontrol < 0) - m_bodydisablecontrol ++; + m_bodydisablecontrol++; d.Vector3 lpos = d.GeomGetPosition(prim_geom); // root position that is seem by rest of simulator @@ -3741,13 +3764,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde public void UpdatePositionAndVelocity(int frame) { - if (_parent == null && !m_disabled && !m_building && !m_outbounds && Body != IntPtr.Zero) + if (_parent == null && !m_isSelected && !m_disabled && !m_building && !m_outbounds && Body != IntPtr.Zero) { - bool bodyenabled = d.BodyIsEnabled(Body); - if(m_bodydisablecontrol < 0) return; + bool bodyenabled = d.BodyIsEnabled(Body); if (bodyenabled || !_zeroFlag) { bool lastZeroFlag = _zeroFlag; @@ -3891,7 +3913,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde // disable interpolators _velocity = Vector3.Zero; m_acceleration = Vector3.Zero; - m_rotationalVelocity = Vector3.Zero; + m_rotationalVelocity = Vector3.Zero; } else { diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs index 844d02b..5758e0a 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs @@ -481,7 +481,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde contactsPerCollision = physicsconfig.GetInt("contacts_per_collision", contactsPerCollision); geomDefaultDensity = physicsconfig.GetFloat("geometry_default_density", geomDefaultDensity); - bodyFramesAutoDisable = physicsconfig.GetInt("body_frames_auto_disable", bodyFramesAutoDisable); +// bodyFramesAutoDisable = physicsconfig.GetInt("body_frames_auto_disable", bodyFramesAutoDisable); physics_logging = physicsconfig.GetBoolean("physics_logging", false); physics_logging_interval = physicsconfig.GetInt("physics_logging_interval", 0); -- cgit v1.1