diff options
author | Melanie | 2012-04-23 21:13:08 +0100 |
---|---|---|
committer | Melanie | 2012-04-23 21:13:08 +0100 |
commit | 159b3b27ca734ab523c47d2ab65397595b1c0a8e (patch) | |
tree | 8038d76c48e48b000e7f96eeade3d335db68daaa /OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs | |
parent | Merge branch 'master' into careminster (diff) | |
parent | ubitODE - do own timing control (as chODE does) until heartbeat does it right (diff) | |
download | opensim-SC-159b3b27ca734ab523c47d2ab65397595b1c0a8e.zip opensim-SC-159b3b27ca734ab523c47d2ab65397595b1c0a8e.tar.gz opensim-SC-159b3b27ca734ab523c47d2ab65397595b1c0a8e.tar.bz2 opensim-SC-159b3b27ca734ab523c47d2ab65397595b1c0a8e.tar.xz |
Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster
Diffstat (limited to 'OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs')
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs index ec4be58..6ffcb9e 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs | |||
@@ -686,6 +686,9 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
686 | 686 | ||
687 | Body = d.BodyCreate(_parent_scene.world); | 687 | Body = d.BodyCreate(_parent_scene.world); |
688 | 688 | ||
689 | _zeroFlag = false; | ||
690 | m_pidControllerActive = true; | ||
691 | |||
689 | d.BodySetAutoDisableFlag(Body, false); | 692 | d.BodySetAutoDisableFlag(Body, false); |
690 | d.BodySetPosition(Body, npositionX, npositionY, npositionZ); | 693 | d.BodySetPosition(Body, npositionX, npositionY, npositionZ); |
691 | 694 | ||
@@ -862,12 +865,12 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
862 | float depth = terrainheight - chrminZ; | 865 | float depth = terrainheight - chrminZ; |
863 | if (!flying) | 866 | if (!flying) |
864 | { | 867 | { |
865 | vec.Z = -vel.Z * PID_D * 1.5f + depth * PID_P * 60; | 868 | vec.Z = -vel.Z * PID_D * 1.5f + depth * PID_P * 50; |
866 | } | 869 | } |
867 | else | 870 | else |
868 | vec.Z = depth * PID_P * 60; | 871 | vec.Z = depth * PID_P * 50; |
869 | 872 | ||
870 | if (depth < 0.2f) | 873 | if (depth < 0.1f) |
871 | { | 874 | { |
872 | m_iscolliding = true; | 875 | m_iscolliding = true; |
873 | m_colliderfilter = 2; | 876 | m_colliderfilter = 2; |
@@ -1009,9 +1012,17 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1009 | 1012 | ||
1010 | // update our local ideia of position velocity and aceleration | 1013 | // update our local ideia of position velocity and aceleration |
1011 | _position = localpos; | 1014 | _position = localpos; |
1012 | _acceleration = _velocity; // previus velocity | 1015 | if (_zeroFlag) |
1013 | _velocity = vel; | 1016 | { |
1014 | _acceleration = (vel - _acceleration) / timeStep; | 1017 | _velocity = Vector3.Zero; |
1018 | _acceleration = Vector3.Zero; | ||
1019 | } | ||
1020 | else | ||
1021 | { | ||
1022 | _acceleration = _velocity; // previus velocity | ||
1023 | _velocity = vel; | ||
1024 | _acceleration = (vel - _acceleration) / timeStep; | ||
1025 | } | ||
1015 | 1026 | ||
1016 | } | 1027 | } |
1017 | 1028 | ||