aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-07-18 17:54:10 +0100
committerJustin Clark-Casey (justincc)2014-07-18 18:03:30 +0100
commitcfbfca64471bf3b0f53a37eb00edbe59855c7497 (patch)
tree9e88c987ee98f0702a8b5f50c78db0b05a307ca6 /OpenSim/Region
parentBulletSim: rearrange code to prevent using null pointers when a (diff)
downloadopensim-SC-cfbfca64471bf3b0f53a37eb00edbe59855c7497.zip
opensim-SC-cfbfca64471bf3b0f53a37eb00edbe59855c7497.tar.gz
opensim-SC-cfbfca64471bf3b0f53a37eb00edbe59855c7497.tar.bz2
opensim-SC-cfbfca64471bf3b0f53a37eb00edbe59855c7497.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')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODECharacter.cs23
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)