Merge branch 'master' into careminster

avinationmerge
Melanie 2012-03-20 20:48:55 +00:00
commit fdd4d787a4
3 changed files with 24 additions and 12 deletions

View File

@ -2374,7 +2374,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
if (direc.Z > 2.0f) if (direc.Z > 2.0f)
{ {
direc.Z *= 3.0f; direc.Z *= 2.5f;
// TODO: PreJump and jump happen too quickly. Many times prejump gets ignored. // TODO: PreJump and jump happen too quickly. Many times prejump gets ignored.
Animator.TrySetMovementAnimation("PREJUMP"); Animator.TrySetMovementAnimation("PREJUMP");

View File

@ -114,6 +114,11 @@ namespace OpenSim.Region.Physics.OdePlugin
private float m_tainted_CAPSULE_LENGTH; // set when the capsule length changes. private float m_tainted_CAPSULE_LENGTH; // set when the capsule length changes.
/// <summary>
/// Base movement for calculating tilt.
/// </summary>
private float m_tiltBaseMovement = (float)Math.Sqrt(2);
/// <summary> /// <summary>
/// Used to introduce a fixed tilt because a straight-up capsule falls through terrain, probably a bug in terrain collider /// Used to introduce a fixed tilt because a straight-up capsule falls through terrain, probably a bug in terrain collider
/// </summary> /// </summary>
@ -524,14 +529,14 @@ namespace OpenSim.Region.Physics.OdePlugin
if (movementVector.Y > 0) if (movementVector.Y > 0)
{ {
// northeast // northeast
movementVector.X = (float)Math.Sqrt(2.0); movementVector.X = m_tiltBaseMovement;
movementVector.Y = (float)Math.Sqrt(2.0); movementVector.Y = m_tiltBaseMovement;
} }
else else
{ {
// southeast // southeast
movementVector.X = (float)Math.Sqrt(2.0); movementVector.X = m_tiltBaseMovement;
movementVector.Y = -(float)Math.Sqrt(2.0); movementVector.Y = -m_tiltBaseMovement;
} }
} }
else else
@ -540,14 +545,14 @@ namespace OpenSim.Region.Physics.OdePlugin
if (movementVector.Y > 0) if (movementVector.Y > 0)
{ {
// northwest // northwest
movementVector.X = -(float)Math.Sqrt(2.0); movementVector.X = -m_tiltBaseMovement;
movementVector.Y = (float)Math.Sqrt(2.0); movementVector.Y = m_tiltBaseMovement;
} }
else else
{ {
// southwest // southwest
movementVector.X = -(float)Math.Sqrt(2.0); movementVector.X = -m_tiltBaseMovement;
movementVector.Y = -(float)Math.Sqrt(2.0); movementVector.Y = -m_tiltBaseMovement;
} }
} }

View File

@ -181,8 +181,15 @@ namespace OpenSim.Region.Physics.OdePlugin
private float avPIDP = 1400f; private float avPIDP = 1400f;
private float avCapRadius = 0.37f; private float avCapRadius = 0.37f;
private float avStandupTensor = 2000000f; private float avStandupTensor = 2000000f;
private bool avCapsuleTilted = true; // true = old compatibility mode with leaning capsule; false = new corrected mode
public bool IsAvCapsuleTilted { get { return avCapsuleTilted; } set { avCapsuleTilted = value; } } /// <summary>
/// true = old compatibility mode with leaning capsule; false = new corrected mode
/// </summary>
/// <remarks>
/// Even when set to false, the capsule still tilts but this is done in a different way.
/// </remarks>
public bool IsAvCapsuleTilted { get; private set; }
private float avDensity = 80f; private float avDensity = 80f;
// private float avHeightFudgeFactor = 0.52f; // private float avHeightFudgeFactor = 0.52f;
private float avMovementDivisorWalk = 1.3f; private float avMovementDivisorWalk = 1.3f;
@ -501,7 +508,7 @@ namespace OpenSim.Region.Physics.OdePlugin
avMovementDivisorWalk = physicsconfig.GetFloat("av_movement_divisor_walk", 1.3f); avMovementDivisorWalk = physicsconfig.GetFloat("av_movement_divisor_walk", 1.3f);
avMovementDivisorRun = physicsconfig.GetFloat("av_movement_divisor_run", 0.8f); avMovementDivisorRun = physicsconfig.GetFloat("av_movement_divisor_run", 0.8f);
avCapRadius = physicsconfig.GetFloat("av_capsule_radius", 0.37f); avCapRadius = physicsconfig.GetFloat("av_capsule_radius", 0.37f);
avCapsuleTilted = physicsconfig.GetBoolean("av_capsule_tilted", false); IsAvCapsuleTilted = physicsconfig.GetBoolean("av_capsule_tilted", false);
contactsPerCollision = physicsconfig.GetInt("contacts_per_collision", 80); contactsPerCollision = physicsconfig.GetInt("contacts_per_collision", 80);