diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
index 6d1f41da05..8397eb4331 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
@@ -114,6 +114,11 @@ namespace OpenSim.Region.Physics.OdePlugin
private float m_tainted_CAPSULE_LENGTH; // set when the capsule length changes.
+ ///
+ /// Base movement for calculating tilt.
+ ///
+ private float m_tiltBaseMovement = (float)Math.Sqrt(2);
+
///
/// Used to introduce a fixed tilt because a straight-up capsule falls through terrain, probably a bug in terrain collider
///
@@ -524,14 +529,14 @@ namespace OpenSim.Region.Physics.OdePlugin
if (movementVector.Y > 0)
{
// northeast
- movementVector.X = (float)Math.Sqrt(2.0);
- movementVector.Y = (float)Math.Sqrt(2.0);
+ movementVector.X = m_tiltBaseMovement;
+ movementVector.Y = m_tiltBaseMovement;
}
else
{
// southeast
- movementVector.X = (float)Math.Sqrt(2.0);
- movementVector.Y = -(float)Math.Sqrt(2.0);
+ movementVector.X = m_tiltBaseMovement;
+ movementVector.Y = -m_tiltBaseMovement;
}
}
else
@@ -540,14 +545,14 @@ namespace OpenSim.Region.Physics.OdePlugin
if (movementVector.Y > 0)
{
// northwest
- movementVector.X = -(float)Math.Sqrt(2.0);
- movementVector.Y = (float)Math.Sqrt(2.0);
+ movementVector.X = -m_tiltBaseMovement;
+ movementVector.Y = m_tiltBaseMovement;
}
else
{
// southwest
- movementVector.X = -(float)Math.Sqrt(2.0);
- movementVector.Y = -(float)Math.Sqrt(2.0);
+ movementVector.X = -m_tiltBaseMovement;
+ movementVector.Y = -m_tiltBaseMovement;
}
}
diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
index 1f8c2ca6b2..842ff916dc 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
@@ -185,6 +185,9 @@ namespace OpenSim.Region.Physics.OdePlugin
///
/// true = old compatibility mode with leaning capsule; false = new corrected mode
///
+ ///
+ /// Even when set to false, the capsule still tilts but this is done in a different way.
+ ///
public bool IsAvCapsuleTilted { get; private set; }
private float avDensity = 80f;