aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs')
-rw-r--r--OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs23
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