diff options
author | Justin Clark-Casey (justincc) | 2014-07-18 17:54:10 +0100 |
---|---|---|
committer | Justin Clark-Casey | 2014-08-02 00:54:57 +0100 |
commit | ad3ce54acabf983092edf73d9584f5e3c713cedc (patch) | |
tree | bb3f5f8c0fe2d7c76acf3c09d96a57eec0054a33 /OpenSim/Region/Physics | |
parent | BulletSim: rearrange code to prevent using null pointers when a (diff) | |
download | opensim-SC_OLD-ad3ce54acabf983092edf73d9584f5e3c713cedc.zip opensim-SC_OLD-ad3ce54acabf983092edf73d9584f5e3c713cedc.tar.gz opensim-SC_OLD-ad3ce54acabf983092edf73d9584f5e3c713cedc.tar.bz2 opensim-SC_OLD-ad3ce54acabf983092edf73d9584f5e3c713cedc.tar.xz |
With ODE physics, fix an issue where the avatar couldn't jump and then move forward when moving south or west.
Addresses http://opensimulator.org/mantis/view.php?id=5003
Thanks to UbitUmarov for this fix.
Diffstat (limited to 'OpenSim/Region/Physics')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 319f6ab..2fac33f 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | |||
@@ -895,30 +895,17 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
895 | // We're colliding with something and we're not flying but we're moving | 895 | // We're colliding with something and we're not flying but we're moving |
896 | // This means we're walking or running. | 896 | // This means we're walking or running. |
897 | d.Vector3 pos = d.BodyGetPosition(Body); | 897 | d.Vector3 pos = d.BodyGetPosition(Body); |
898 | vec.Z = (_target_velocity.Z - vel.Z)*PID_D + (_zeroPosition.Z - pos.Z)*PID_P; | 898 | vec.Z = (_target_velocity.Z - vel.Z) * PID_D + (_zeroPosition.Z - pos.Z) * PID_P; |
899 | if (_target_velocity.X > 0) | 899 | vec.X = ((_target_velocity.X - vel.X) / 1.2f) * PID_D; |
900 | { | 900 | vec.Y = ((_target_velocity.Y - vel.Y) / 1.2f) * PID_D; |
901 | vec.X = ((_target_velocity.X - vel.X) / 1.2f) * PID_D; | ||
902 | } | ||
903 | if (_target_velocity.Y > 0) | ||
904 | { | ||
905 | vec.Y = ((_target_velocity.Y - vel.Y) / 1.2f) * PID_D; | ||
906 | } | ||
907 | } | 901 | } |
908 | else if (!m_iscolliding && !flying) | 902 | else if (!m_iscolliding && !flying) |
909 | { | 903 | { |
910 | // we're not colliding and we're not flying so that means we're falling! | 904 | // we're not colliding and we're not flying so that means we're falling! |
911 | // m_iscolliding includes collisions with the ground. | 905 | // m_iscolliding includes collisions with the ground. |
912 | 906 | ||
913 | // d.Vector3 pos = d.BodyGetPosition(Body); | 907 | vec.X = ((_target_velocity.X - vel.X) / 1.2f) * PID_D; |
914 | if (_target_velocity.X > 0) | 908 | vec.Y = ((_target_velocity.Y - vel.Y) / 1.2f) * PID_D; |
915 | { | ||
916 | vec.X = ((_target_velocity.X - vel.X) / 1.2f) * PID_D; | ||
917 | } | ||
918 | if (_target_velocity.Y > 0) | ||
919 | { | ||
920 | vec.Y = ((_target_velocity.Y - vel.Y) / 1.2f) * PID_D; | ||
921 | } | ||
922 | } | 909 | } |
923 | 910 | ||
924 | if (flying) | 911 | if (flying) |