* Implemented Walk Vs Run in ODE. Also helps make the walk look smoother.

* All thanks to unimplemented packet listing :D
This commit is contained in:
Teravus Ovares
2007-11-12 23:46:26 +00:00
parent 5952441fcc
commit d9d35f9fd7
11 changed files with 81 additions and 6 deletions

View File

@@ -206,6 +206,11 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
get { return m_rotationalVelocity; }
set { m_rotationalVelocity = value; }
}
public override bool SetAlwaysRun
{
get { return false; }
set { return; }
}
public override bool IsPhysical
{
get { return false; }

View File

@@ -764,7 +764,11 @@ namespace OpenSim.Region.Physics.BulletXPlugin
return;
}
}
public override bool SetAlwaysRun
{
get { return false; }
set { return; }
}
public override PhysicsVector Acceleration
{
get { return _acceleration; }

View File

@@ -153,7 +153,7 @@ namespace OpenSim.Region.Physics.Manager
public abstract bool IsPhysical {get; set;}
public abstract bool Flying { get; set; }
public abstract bool SetAlwaysRun { get; set; }
public abstract bool ThrottleUpdates { get; set; }
public abstract bool IsColliding { get; set; }
@@ -176,6 +176,11 @@ namespace OpenSim.Region.Physics.Manager
get { return PhysicsVector.Zero; }
set { return; }
}
public override bool SetAlwaysRun
{
get { return false; }
set { return; }
}
public override bool CollidingGround
{
get {return false;}

View File

@@ -660,6 +660,7 @@ namespace OpenSim.Region.Physics.OdePlugin
private bool flying = false;
private bool m_iscolliding = false;
private bool m_wascolliding = false;
private bool m_alwaysRun = false;
private bool[] m_colliderarr = new bool[11];
@@ -702,6 +703,11 @@ namespace OpenSim.Region.Physics.OdePlugin
get { return (int)ActorTypes.Agent; }
set { return; }
}
public override bool SetAlwaysRun
{
get { return m_alwaysRun; }
set { m_alwaysRun = value;}
}
public override bool IsPhysical
{
get { return false; }
@@ -876,6 +882,17 @@ namespace OpenSim.Region.Physics.OdePlugin
// no lock; for now it's only called from within Simulate()
PhysicsVector vec = new PhysicsVector();
d.Vector3 vel = d.BodyGetLinearVel(Body);
float movementdivisor = 1f;
if (!m_alwaysRun)
{
movementdivisor = 10.5f;
}
else
{
movementdivisor = 0.2079f;
}
// if velocity is zero, use position control; otherwise, velocity control
if (_target_velocity.X == 0.0f && _target_velocity.Y == 0.0f && _target_velocity.Z == 0.0f && m_iscolliding)
@@ -900,8 +917,9 @@ namespace OpenSim.Region.Physics.OdePlugin
_zeroFlag = false;
if (m_iscolliding || flying)
{
vec.X = (_target_velocity.X - vel.X) * PID_D;
vec.Y = (_target_velocity.Y - vel.Y) * PID_D;
vec.X = ((_target_velocity.X - vel.X)/movementdivisor) * PID_D;
vec.Y = ((_target_velocity.Y - vel.Y)/movementdivisor) * PID_D;
}
if (m_iscolliding && !flying && _target_velocity.Z > 0.0f)
{
@@ -1077,6 +1095,11 @@ namespace OpenSim.Region.Physics.OdePlugin
get { return (int)ActorTypes.Prim; }
set { return; }
}
public override bool SetAlwaysRun
{
get { return false; }
set { return; }
}
public void enableBody()
{
// Sets the geom to a body

View File

@@ -209,6 +209,11 @@ namespace OpenSim.Region.Physics.PhysXPlugin
get { return (int)ActorTypes.Agent; }
set { return; }
}
public override bool SetAlwaysRun
{
get { return false; }
set { return; }
}
public override bool IsPhysical
{
get { return false; }
@@ -363,6 +368,11 @@ namespace OpenSim.Region.Physics.PhysXPlugin
get { return false; }
set { return; }
}
public override bool SetAlwaysRun
{
get { return false; }
set { return; }
}
public override bool ThrottleUpdates
{
get { return false; }