diff options
author | Teravus Ovares | 2007-11-12 23:46:26 +0000 |
---|---|---|
committer | Teravus Ovares | 2007-11-12 23:46:26 +0000 |
commit | d9d35f9fd7141d8f7a5b3b056cae051d6de2efd5 (patch) | |
tree | 37a49b26a6cb07d1fdc3e419222ea2147eaa089e /OpenSim/Region/Physics | |
parent | * Added a lot of Glue to help with reporting proper collisions. (diff) | |
download | opensim-SC-d9d35f9fd7141d8f7a5b3b056cae051d6de2efd5.zip opensim-SC-d9d35f9fd7141d8f7a5b3b056cae051d6de2efd5.tar.gz opensim-SC-d9d35f9fd7141d8f7a5b3b056cae051d6de2efd5.tar.bz2 opensim-SC-d9d35f9fd7141d8f7a5b3b056cae051d6de2efd5.tar.xz |
* Implemented Walk Vs Run in ODE. Also helps make the walk look smoother.
* All thanks to unimplemented packet listing :D
Diffstat (limited to 'OpenSim/Region/Physics')
5 files changed, 51 insertions, 4 deletions
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs index 3283ec0..2582097 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs +++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs | |||
@@ -206,6 +206,11 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin | |||
206 | get { return m_rotationalVelocity; } | 206 | get { return m_rotationalVelocity; } |
207 | set { m_rotationalVelocity = value; } | 207 | set { m_rotationalVelocity = value; } |
208 | } | 208 | } |
209 | public override bool SetAlwaysRun | ||
210 | { | ||
211 | get { return false; } | ||
212 | set { return; } | ||
213 | } | ||
209 | public override bool IsPhysical | 214 | public override bool IsPhysical |
210 | { | 215 | { |
211 | get { return false; } | 216 | get { return false; } |
diff --git a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs index b51f024..f78e99e 100644 --- a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs +++ b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs | |||
@@ -764,7 +764,11 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
764 | return; | 764 | return; |
765 | } | 765 | } |
766 | } | 766 | } |
767 | 767 | public override bool SetAlwaysRun | |
768 | { | ||
769 | get { return false; } | ||
770 | set { return; } | ||
771 | } | ||
768 | public override PhysicsVector Acceleration | 772 | public override PhysicsVector Acceleration |
769 | { | 773 | { |
770 | get { return _acceleration; } | 774 | get { return _acceleration; } |
diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index 49760da..84b451f 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs | |||
@@ -153,7 +153,7 @@ namespace OpenSim.Region.Physics.Manager | |||
153 | public abstract bool IsPhysical {get; set;} | 153 | public abstract bool IsPhysical {get; set;} |
154 | 154 | ||
155 | public abstract bool Flying { get; set; } | 155 | public abstract bool Flying { get; set; } |
156 | 156 | public abstract bool SetAlwaysRun { get; set; } | |
157 | public abstract bool ThrottleUpdates { get; set; } | 157 | public abstract bool ThrottleUpdates { get; set; } |
158 | 158 | ||
159 | public abstract bool IsColliding { get; set; } | 159 | public abstract bool IsColliding { get; set; } |
@@ -176,6 +176,11 @@ namespace OpenSim.Region.Physics.Manager | |||
176 | get { return PhysicsVector.Zero; } | 176 | get { return PhysicsVector.Zero; } |
177 | set { return; } | 177 | set { return; } |
178 | } | 178 | } |
179 | public override bool SetAlwaysRun | ||
180 | { | ||
181 | get { return false; } | ||
182 | set { return; } | ||
183 | } | ||
179 | public override bool CollidingGround | 184 | public override bool CollidingGround |
180 | { | 185 | { |
181 | get {return false;} | 186 | get {return false;} |
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index c93b96f..b528b9b 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | |||
@@ -660,6 +660,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
660 | private bool flying = false; | 660 | private bool flying = false; |
661 | private bool m_iscolliding = false; | 661 | private bool m_iscolliding = false; |
662 | private bool m_wascolliding = false; | 662 | private bool m_wascolliding = false; |
663 | private bool m_alwaysRun = false; | ||
663 | 664 | ||
664 | private bool[] m_colliderarr = new bool[11]; | 665 | private bool[] m_colliderarr = new bool[11]; |
665 | 666 | ||
@@ -702,6 +703,11 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
702 | get { return (int)ActorTypes.Agent; } | 703 | get { return (int)ActorTypes.Agent; } |
703 | set { return; } | 704 | set { return; } |
704 | } | 705 | } |
706 | public override bool SetAlwaysRun | ||
707 | { | ||
708 | get { return m_alwaysRun; } | ||
709 | set { m_alwaysRun = value;} | ||
710 | } | ||
705 | public override bool IsPhysical | 711 | public override bool IsPhysical |
706 | { | 712 | { |
707 | get { return false; } | 713 | get { return false; } |
@@ -876,6 +882,17 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
876 | // no lock; for now it's only called from within Simulate() | 882 | // no lock; for now it's only called from within Simulate() |
877 | PhysicsVector vec = new PhysicsVector(); | 883 | PhysicsVector vec = new PhysicsVector(); |
878 | d.Vector3 vel = d.BodyGetLinearVel(Body); | 884 | d.Vector3 vel = d.BodyGetLinearVel(Body); |
885 | float movementdivisor = 1f; | ||
886 | |||
887 | if (!m_alwaysRun) | ||
888 | { | ||
889 | movementdivisor = 10.5f; | ||
890 | } | ||
891 | else | ||
892 | { | ||
893 | movementdivisor = 0.2079f; | ||
894 | |||
895 | } | ||
879 | 896 | ||
880 | // if velocity is zero, use position control; otherwise, velocity control | 897 | // if velocity is zero, use position control; otherwise, velocity control |
881 | if (_target_velocity.X == 0.0f && _target_velocity.Y == 0.0f && _target_velocity.Z == 0.0f && m_iscolliding) | 898 | 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 | |||
900 | _zeroFlag = false; | 917 | _zeroFlag = false; |
901 | if (m_iscolliding || flying) | 918 | if (m_iscolliding || flying) |
902 | { | 919 | { |
903 | vec.X = (_target_velocity.X - vel.X) * PID_D; | 920 | |
904 | vec.Y = (_target_velocity.Y - vel.Y) * PID_D; | 921 | vec.X = ((_target_velocity.X - vel.X)/movementdivisor) * PID_D; |
922 | vec.Y = ((_target_velocity.Y - vel.Y)/movementdivisor) * PID_D; | ||
905 | } | 923 | } |
906 | if (m_iscolliding && !flying && _target_velocity.Z > 0.0f) | 924 | if (m_iscolliding && !flying && _target_velocity.Z > 0.0f) |
907 | { | 925 | { |
@@ -1077,6 +1095,11 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1077 | get { return (int)ActorTypes.Prim; } | 1095 | get { return (int)ActorTypes.Prim; } |
1078 | set { return; } | 1096 | set { return; } |
1079 | } | 1097 | } |
1098 | public override bool SetAlwaysRun | ||
1099 | { | ||
1100 | get { return false; } | ||
1101 | set { return; } | ||
1102 | } | ||
1080 | public void enableBody() | 1103 | public void enableBody() |
1081 | { | 1104 | { |
1082 | // Sets the geom to a body | 1105 | // Sets the geom to a body |
diff --git a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs index 1396458..4805d79 100644 --- a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs +++ b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs | |||
@@ -209,6 +209,11 @@ namespace OpenSim.Region.Physics.PhysXPlugin | |||
209 | get { return (int)ActorTypes.Agent; } | 209 | get { return (int)ActorTypes.Agent; } |
210 | set { return; } | 210 | set { return; } |
211 | } | 211 | } |
212 | public override bool SetAlwaysRun | ||
213 | { | ||
214 | get { return false; } | ||
215 | set { return; } | ||
216 | } | ||
212 | public override bool IsPhysical | 217 | public override bool IsPhysical |
213 | { | 218 | { |
214 | get { return false; } | 219 | get { return false; } |
@@ -363,6 +368,11 @@ namespace OpenSim.Region.Physics.PhysXPlugin | |||
363 | get { return false; } | 368 | get { return false; } |
364 | set { return; } | 369 | set { return; } |
365 | } | 370 | } |
371 | public override bool SetAlwaysRun | ||
372 | { | ||
373 | get { return false; } | ||
374 | set { return; } | ||
375 | } | ||
366 | public override bool ThrottleUpdates | 376 | public override bool ThrottleUpdates |
367 | { | 377 | { |
368 | get { return false; } | 378 | get { return false; } |