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)
parent
1dc56eb15f
commit
dfef16297b
|
@ -345,6 +345,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||||
if (rootPrim.Body != IntPtr.Zero && !d.BodyIsEnabled(rootPrim.Body)
|
if (rootPrim.Body != IntPtr.Zero && !d.BodyIsEnabled(rootPrim.Body)
|
||||||
&& !rootPrim.m_isSelected && !rootPrim.m_disabled)
|
&& !rootPrim.m_isSelected && !rootPrim.m_disabled)
|
||||||
d.BodyEnable(rootPrim.Body);
|
d.BodyEnable(rootPrim.Body);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case Vehicle.LINEAR_FRICTION_TIMESCALE:
|
case Vehicle.LINEAR_FRICTION_TIMESCALE:
|
||||||
if (pValue < m_timestep) pValue = m_timestep;
|
if (pValue < m_timestep) pValue = m_timestep;
|
||||||
|
|
|
@ -1847,8 +1847,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||||
ApplyCollisionCatFlags();
|
ApplyCollisionCatFlags();
|
||||||
|
|
||||||
_zeroFlag = true;
|
_zeroFlag = true;
|
||||||
|
d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames);
|
||||||
d.BodyEnable(Body);
|
d.BodyEnable(Body);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
resetCollisionAccounting();
|
resetCollisionAccounting();
|
||||||
|
@ -2900,6 +2900,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||||
if (Body != IntPtr.Zero && !m_disabled)
|
if (Body != IntPtr.Zero && !m_disabled)
|
||||||
{
|
{
|
||||||
_zeroFlag = true;
|
_zeroFlag = true;
|
||||||
|
d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames);
|
||||||
d.BodyEnable(Body);
|
d.BodyEnable(Body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2933,6 +2934,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||||
if (!d.BodyIsEnabled(Body))
|
if (!d.BodyIsEnabled(Body))
|
||||||
{
|
{
|
||||||
_zeroFlag = true;
|
_zeroFlag = true;
|
||||||
|
d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames);
|
||||||
d.BodyEnable(Body);
|
d.BodyEnable(Body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2947,6 +2949,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||||
if (Body != IntPtr.Zero && !d.BodyIsEnabled(Body))
|
if (Body != IntPtr.Zero && !d.BodyIsEnabled(Body))
|
||||||
{
|
{
|
||||||
_zeroFlag = true;
|
_zeroFlag = true;
|
||||||
|
d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames);
|
||||||
d.BodyEnable(Body);
|
d.BodyEnable(Body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3012,6 +3015,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||||
if (Body != IntPtr.Zero && !d.BodyIsEnabled(Body))
|
if (Body != IntPtr.Zero && !d.BodyIsEnabled(Body))
|
||||||
{
|
{
|
||||||
_zeroFlag = true;
|
_zeroFlag = true;
|
||||||
|
d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames);
|
||||||
d.BodyEnable(Body);
|
d.BodyEnable(Body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3070,6 +3074,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||||
if (Body != IntPtr.Zero && !d.BodyIsEnabled(Body))
|
if (Body != IntPtr.Zero && !d.BodyIsEnabled(Body))
|
||||||
{
|
{
|
||||||
_zeroFlag = true;
|
_zeroFlag = true;
|
||||||
|
d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames);
|
||||||
d.BodyEnable(Body);
|
d.BodyEnable(Body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3312,8 +3317,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||||
if (m_disabled)
|
if (m_disabled)
|
||||||
enableBodySoft();
|
enableBodySoft();
|
||||||
else if (!d.BodyIsEnabled(Body))
|
else if (!d.BodyIsEnabled(Body))
|
||||||
|
{
|
||||||
|
d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames);
|
||||||
d.BodyEnable(Body);
|
d.BodyEnable(Body);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
m_torque = newtorque;
|
m_torque = newtorque;
|
||||||
}
|
}
|
||||||
|
@ -3323,8 +3330,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||||
{
|
{
|
||||||
m_force = force;
|
m_force = force;
|
||||||
if (!m_isSelected && !m_outbounds && Body != IntPtr.Zero && !d.BodyIsEnabled(Body))
|
if (!m_isSelected && !m_outbounds && Body != IntPtr.Zero && !d.BodyIsEnabled(Body))
|
||||||
|
{
|
||||||
|
d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames);
|
||||||
d.BodyEnable(Body);
|
d.BodyEnable(Body);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void changeAddForce(Vector3 theforce)
|
private void changeAddForce(Vector3 theforce)
|
||||||
{
|
{
|
||||||
|
@ -3339,9 +3349,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||||
if (m_disabled)
|
if (m_disabled)
|
||||||
enableBodySoft();
|
enableBodySoft();
|
||||||
else if (!d.BodyIsEnabled(Body))
|
else if (!d.BodyIsEnabled(Body))
|
||||||
|
{
|
||||||
|
d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames);
|
||||||
d.BodyEnable(Body);
|
d.BodyEnable(Body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
m_collisionscore = 0;
|
m_collisionscore = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3359,9 +3372,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||||
if (m_disabled)
|
if (m_disabled)
|
||||||
enableBodySoft();
|
enableBodySoft();
|
||||||
else if (!d.BodyIsEnabled(Body))
|
else if (!d.BodyIsEnabled(Body))
|
||||||
|
{
|
||||||
|
d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames);
|
||||||
d.BodyEnable(Body);
|
d.BodyEnable(Body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
m_collisionscore = 0;
|
m_collisionscore = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3382,7 +3398,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||||
if (m_disabled)
|
if (m_disabled)
|
||||||
enableBodySoft();
|
enableBodySoft();
|
||||||
else if (!d.BodyIsEnabled(Body))
|
else if (!d.BodyIsEnabled(Body))
|
||||||
|
{
|
||||||
|
d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames);
|
||||||
d.BodyEnable(Body);
|
d.BodyEnable(Body);
|
||||||
|
}
|
||||||
d.BodySetLinearVel(Body, newVel.X, newVel.Y, newVel.Z);
|
d.BodySetLinearVel(Body, newVel.X, newVel.Y, newVel.Z);
|
||||||
}
|
}
|
||||||
//resetCollisionAccounting();
|
//resetCollisionAccounting();
|
||||||
|
@ -3406,7 +3425,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||||
if (m_disabled)
|
if (m_disabled)
|
||||||
enableBodySoft();
|
enableBodySoft();
|
||||||
else if (!d.BodyIsEnabled(Body))
|
else if (!d.BodyIsEnabled(Body))
|
||||||
|
{
|
||||||
|
d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames);
|
||||||
d.BodyEnable(Body);
|
d.BodyEnable(Body);
|
||||||
|
}
|
||||||
d.BodySetAngularVel(Body, newAngVel.X, newAngVel.Y, newAngVel.Z);
|
d.BodySetAngularVel(Body, newAngVel.X, newAngVel.Y, newAngVel.Z);
|
||||||
}
|
}
|
||||||
//resetCollisionAccounting();
|
//resetCollisionAccounting();
|
||||||
|
@ -3571,12 +3593,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||||
d.BodySetAngularVel(Body,0f,0f,0f);
|
d.BodySetAngularVel(Body,0f,0f,0f);
|
||||||
d.BodySetLinearVel(Body,0f,0f,0f);
|
d.BodySetLinearVel(Body,0f,0f,0f);
|
||||||
_zeroFlag = true;
|
_zeroFlag = true;
|
||||||
|
d.BodySetAutoDisableSteps(Body, 1);
|
||||||
d.BodyEnable(Body);
|
d.BodyEnable(Body);
|
||||||
m_bodydisablecontrol = -4;
|
m_bodydisablecontrol = -4;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_bodydisablecontrol < 0)
|
if(m_bodydisablecontrol < 0)
|
||||||
m_bodydisablecontrol ++;
|
m_bodydisablecontrol++;
|
||||||
|
|
||||||
d.Vector3 lpos = d.GeomGetPosition(prim_geom); // root position that is seem by rest of simulator
|
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)
|
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)
|
if(m_bodydisablecontrol < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
bool bodyenabled = d.BodyIsEnabled(Body);
|
||||||
if (bodyenabled || !_zeroFlag)
|
if (bodyenabled || !_zeroFlag)
|
||||||
{
|
{
|
||||||
bool lastZeroFlag = _zeroFlag;
|
bool lastZeroFlag = _zeroFlag;
|
||||||
|
|
|
@ -481,7 +481,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||||
contactsPerCollision = physicsconfig.GetInt("contacts_per_collision", contactsPerCollision);
|
contactsPerCollision = physicsconfig.GetInt("contacts_per_collision", contactsPerCollision);
|
||||||
|
|
||||||
geomDefaultDensity = physicsconfig.GetFloat("geometry_default_density", geomDefaultDensity);
|
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 = physicsconfig.GetBoolean("physics_logging", false);
|
||||||
physics_logging_interval = physicsconfig.GetInt("physics_logging_interval", 0);
|
physics_logging_interval = physicsconfig.GetInt("physics_logging_interval", 0);
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue