ODE turn off material dependent friction while vehicle linear motor is Effective. Increase a bit world damping of velocities
parent
ce7864632b
commit
d50b852d53
|
@ -137,6 +137,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
float m_amdampY;
|
||||
float m_amdampZ;
|
||||
|
||||
|
||||
public float FrictionFactor
|
||||
{
|
||||
get
|
||||
|
@ -145,6 +146,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public ODEDynamics(OdePrim rootp)
|
||||
{
|
||||
rootPrim = rootp;
|
||||
|
@ -345,7 +347,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
m_lmDecay = 1.0f - 1.0f / m_linearMotorDecayTimescale;
|
||||
m_lmEfect = 1.0f; // turn it on
|
||||
|
||||
m_ffactor = 0.01f;
|
||||
m_ffactor = 0.0f;
|
||||
if (rootPrim.Body != IntPtr.Zero && !d.BodyIsEnabled(rootPrim.Body)
|
||||
&& !rootPrim.m_isSelected && !rootPrim.m_disabled)
|
||||
d.BodyEnable(rootPrim.Body);
|
||||
|
@ -401,7 +403,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
m_lmEfect = 1.0f; // turn it on
|
||||
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)
|
||||
&& !rootPrim.m_isSelected && !rootPrim.m_disabled)
|
||||
d.BodyEnable(rootPrim.Body);
|
||||
|
@ -805,7 +807,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
}
|
||||
|
||||
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
|
||||
{
|
||||
|
|
|
@ -275,6 +275,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
|
||||
if (veh != null && veh.Type != Vehicle.TYPE_NONE)
|
||||
cdata.mu *= veh.FrictionFactor;
|
||||
// cdata.mu *= 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -526,8 +526,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
d.WorldSetGravity(world, gravityx, gravityy, gravityz);
|
||||
d.WorldSetContactSurfaceLayer(world, contactsurfacelayer);
|
||||
|
||||
d.WorldSetLinearDamping(world, 0.001f);
|
||||
d.WorldSetAngularDamping(world, 0.001f);
|
||||
d.WorldSetLinearDamping(world, 0.002f);
|
||||
d.WorldSetAngularDamping(world, 0.002f);
|
||||
d.WorldSetAngularDampingThreshold(world, 0f);
|
||||
d.WorldSetLinearDampingThreshold(world, 0f);
|
||||
d.WorldSetMaxAngularSpeed(world, 100f);
|
||||
|
|
Loading…
Reference in New Issue