ODE turn off material dependent friction while vehicle linear motor is Effective. Increase a bit world damping of velocities

avinationmerge
UbitUmarov 2012-07-07 03:16:41 +01:00
parent ce7864632b
commit d50b852d53
3 changed files with 9 additions and 5 deletions

View File

@ -137,6 +137,7 @@ namespace OpenSim.Region.Physics.OdePlugin
float m_amdampY; float m_amdampY;
float m_amdampZ; float m_amdampZ;
public float FrictionFactor public float FrictionFactor
{ {
get get
@ -145,6 +146,7 @@ namespace OpenSim.Region.Physics.OdePlugin
} }
} }
public ODEDynamics(OdePrim rootp) public ODEDynamics(OdePrim rootp)
{ {
rootPrim = rootp; rootPrim = rootp;
@ -345,7 +347,7 @@ namespace OpenSim.Region.Physics.OdePlugin
m_lmDecay = 1.0f - 1.0f / m_linearMotorDecayTimescale; m_lmDecay = 1.0f - 1.0f / m_linearMotorDecayTimescale;
m_lmEfect = 1.0f; // turn it on m_lmEfect = 1.0f; // turn it on
m_ffactor = 0.01f; m_ffactor = 0.0f;
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);
@ -401,7 +403,7 @@ namespace OpenSim.Region.Physics.OdePlugin
m_lmEfect = 1.0f; // turn it on m_lmEfect = 1.0f; // turn it on
m_lmDecay = 1.0f - 1.0f / m_linearMotorDecayTimescale; m_lmDecay = 1.0f - 1.0f / m_linearMotorDecayTimescale;
m_ffactor = 0.01f; m_ffactor = 0.0f;
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);
@ -805,7 +807,8 @@ namespace OpenSim.Region.Physics.OdePlugin
} }
m_lmEfect *= m_lmDecay; m_lmEfect *= m_lmDecay;
m_ffactor = 0.01f + 1e-4f * curVel.LengthSquared(); // m_ffactor = 0.01f + 1e-4f * curVel.LengthSquared();
m_ffactor = 0.0f;
} }
else else
{ {

View File

@ -275,6 +275,7 @@ namespace OpenSim.Region.Physics.OdePlugin
if (veh != null && veh.Type != Vehicle.TYPE_NONE) if (veh != null && veh.Type != Vehicle.TYPE_NONE)
cdata.mu *= veh.FrictionFactor; cdata.mu *= veh.FrictionFactor;
// cdata.mu *= 0;
} }
} }

View File

@ -526,8 +526,8 @@ namespace OpenSim.Region.Physics.OdePlugin
d.WorldSetGravity(world, gravityx, gravityy, gravityz); d.WorldSetGravity(world, gravityx, gravityy, gravityz);
d.WorldSetContactSurfaceLayer(world, contactsurfacelayer); d.WorldSetContactSurfaceLayer(world, contactsurfacelayer);
d.WorldSetLinearDamping(world, 0.001f); d.WorldSetLinearDamping(world, 0.002f);
d.WorldSetAngularDamping(world, 0.001f); d.WorldSetAngularDamping(world, 0.002f);
d.WorldSetAngularDampingThreshold(world, 0f); d.WorldSetAngularDampingThreshold(world, 0f);
d.WorldSetLinearDampingThreshold(world, 0f); d.WorldSetLinearDampingThreshold(world, 0f);
d.WorldSetMaxAngularSpeed(world, 100f); d.WorldSetMaxAngularSpeed(world, 100f);