reduced instability in vertical atractor with eficiency of 1 and banking

this will need a nicer solution sometime...
avinationmerge
UbitUmarov 2012-03-31 00:03:45 +01:00
parent 1888e174cd
commit c4e4e04eee
1 changed files with 13 additions and 9 deletions

View File

@ -153,7 +153,7 @@ namespace OpenSim.Region.Physics.OdePlugin
if (m_linearFrictionTimescale.Z < timestep) m_linearFrictionTimescale.Z = timestep; if (m_linearFrictionTimescale.Z < timestep) m_linearFrictionTimescale.Z = timestep;
m_linearMotorDecayTimescale = vd.m_linearMotorDecayTimescale; m_linearMotorDecayTimescale = vd.m_linearMotorDecayTimescale;
if (m_linearMotorDecayTimescale < 0.5f) m_linearMotorDecayTimescale = 0.5f; if (m_linearMotorDecayTimescale < timestep) m_linearMotorDecayTimescale = timestep;
m_linearMotorDecayTimescale *= invtimestep; m_linearMotorDecayTimescale *= invtimestep;
m_linearMotorTimescale = vd.m_linearMotorTimescale; m_linearMotorTimescale = vd.m_linearMotorTimescale;
@ -168,7 +168,7 @@ namespace OpenSim.Region.Physics.OdePlugin
if (m_angularMotorTimescale < timestep) m_angularMotorTimescale = timestep; if (m_angularMotorTimescale < timestep) m_angularMotorTimescale = timestep;
m_angularMotorDecayTimescale = vd.m_angularMotorDecayTimescale; m_angularMotorDecayTimescale = vd.m_angularMotorDecayTimescale;
if (m_angularMotorDecayTimescale < 0.5f) m_angularMotorDecayTimescale = 0.5f; if (m_angularMotorDecayTimescale < timestep) m_angularMotorDecayTimescale = timestep;
m_angularMotorDecayTimescale *= invtimestep; m_angularMotorDecayTimescale *= invtimestep;
m_angularFrictionTimescale = vd.m_angularFrictionTimescale; m_angularFrictionTimescale = vd.m_angularFrictionTimescale;
@ -230,9 +230,9 @@ namespace OpenSim.Region.Physics.OdePlugin
m_angularDeflectionTimescale = pValue; m_angularDeflectionTimescale = pValue;
break; break;
case Vehicle.ANGULAR_MOTOR_DECAY_TIMESCALE: case Vehicle.ANGULAR_MOTOR_DECAY_TIMESCALE:
// if (pValue < timestep) pValue = timestep; if (pValue < timestep) pValue = timestep;
// try to make impulses to work a bit better // try to make impulses to work a bit better
if (pValue < 0.5f) pValue = 0.5f; // if (pValue < 0.5f) pValue = 0.5f;
else if (pValue > 120) pValue = 120; else if (pValue > 120) pValue = 120;
m_angularMotorDecayTimescale = pValue * invtimestep; m_angularMotorDecayTimescale = pValue * invtimestep;
break; break;
@ -281,9 +281,9 @@ namespace OpenSim.Region.Physics.OdePlugin
m_linearDeflectionTimescale = pValue; m_linearDeflectionTimescale = pValue;
break; break;
case Vehicle.LINEAR_MOTOR_DECAY_TIMESCALE: case Vehicle.LINEAR_MOTOR_DECAY_TIMESCALE:
// if (pValue < timestep) pValue = timestep; if (pValue < timestep) pValue = timestep;
// try to make impulses to work a bit better // try to make impulses to work a bit better
if (pValue < 0.5f) pValue = 0.5f; //if (pValue < 0.5f) pValue = 0.5f;
else if (pValue > 120) pValue = 120; else if (pValue > 120) pValue = 120;
m_linearMotorDecayTimescale = pValue * invtimestep; m_linearMotorDecayTimescale = pValue * invtimestep;
break; break;
@ -444,9 +444,9 @@ namespace OpenSim.Region.Physics.OdePlugin
m_linearFrictionTimescale = new Vector3(1000, 1000, 1000); m_linearFrictionTimescale = new Vector3(1000, 1000, 1000);
m_angularFrictionTimescale = new Vector3(1000, 1000, 1000); m_angularFrictionTimescale = new Vector3(1000, 1000, 1000);
m_linearMotorTimescale = 1000; m_linearMotorTimescale = 1000;
m_linearMotorDecayTimescale = 120; m_linearMotorDecayTimescale = 120 * invtimestep;
m_angularMotorTimescale = 1000; m_angularMotorTimescale = 1000;
m_angularMotorDecayTimescale = 1000; m_angularMotorDecayTimescale = 1000 * invtimestep;
m_VhoverHeight = 0; m_VhoverHeight = 0;
m_VhoverEfficiency = 1; m_VhoverEfficiency = 1;
m_VhoverTimescale = 1000; m_VhoverTimescale = 1000;
@ -901,7 +901,11 @@ namespace OpenSim.Region.Physics.OdePlugin
GetRollPitch(irotq, out roll, out pitch); GetRollPitch(irotq, out roll, out pitch);
float ftmp = 1.0f / m_verticalAttractionTimescale / m_verticalAttractionTimescale / _pParentScene.ODE_STEPSIZE; float ftmp = 1.0f / m_verticalAttractionTimescale / m_verticalAttractionTimescale / _pParentScene.ODE_STEPSIZE;
float ftmp2 = m_verticalAttractionEfficiency / _pParentScene.ODE_STEPSIZE; float ftmp2;
if (m_bankingEfficiency == 0)
ftmp2 = m_verticalAttractionEfficiency / _pParentScene.ODE_STEPSIZE;
else
ftmp2 = 0;
if (roll > halfpi) if (roll > halfpi)
roll = pi - roll; roll = pi - roll;