diff options
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 92927e4..7f3ae6b 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | |||
@@ -886,7 +886,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
886 | d.BodyAddForce(Body, force.X, force.Y, force.Z); | 886 | d.BodyAddForce(Body, force.X, force.Y, force.Z); |
887 | //d.BodySetRotation(Body, ref m_StandUpRotation); | 887 | //d.BodySetRotation(Body, ref m_StandUpRotation); |
888 | //standupStraight(); | 888 | //standupStraight(); |
889 | |||
890 | } | 889 | } |
891 | } | 890 | } |
892 | 891 | ||
@@ -901,7 +900,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
901 | /// <param name="timeStep"></param> | 900 | /// <param name="timeStep"></param> |
902 | /// <param name="defects"> | 901 | /// <param name="defects"> |
903 | /// If there is something wrong with the character (e.g. its position is non-finite) | 902 | /// If there is something wrong with the character (e.g. its position is non-finite) |
904 | /// then it is added to this list. The ODE structures associated with it are also destroyed.</param> | 903 | /// then it is added to this list. The ODE structures associated with it are also destroyed. |
904 | /// </param> | ||
905 | public void Move(float timeStep, List<OdeCharacter> defects) | 905 | public void Move(float timeStep, List<OdeCharacter> defects) |
906 | { | 906 | { |
907 | // no lock; for now it's only called from within Simulate() | 907 | // no lock; for now it's only called from within Simulate() |
@@ -966,7 +966,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
966 | 966 | ||
967 | d.Vector3 pos = d.BodyGetPosition(Body); | 967 | d.Vector3 pos = d.BodyGetPosition(Body); |
968 | vec.X = (_target_velocity.X - vel.X) * (PID_D) + (_zeroPosition.X - pos.X) * (PID_P * 2); | 968 | vec.X = (_target_velocity.X - vel.X) * (PID_D) + (_zeroPosition.X - pos.X) * (PID_P * 2); |
969 | vec.Y = (_target_velocity.Y - vel.Y)*(PID_D) + (_zeroPosition.Y - pos.Y)* (PID_P * 2); | 969 | vec.Y = (_target_velocity.Y - vel.Y) * (PID_D) + (_zeroPosition.Y - pos.Y)* (PID_P * 2); |
970 | if (flying) | 970 | if (flying) |
971 | { | 971 | { |
972 | vec.Z = (_target_velocity.Z - vel.Z) * (PID_D) + (_zeroPosition.Z - pos.Z) * PID_P; | 972 | vec.Z = (_target_velocity.Z - vel.Z) * (PID_D) + (_zeroPosition.Z - pos.Z) * PID_P; |
@@ -995,6 +995,10 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
995 | // we're in mid air suspended | 995 | // we're in mid air suspended |
996 | vec.X = ((_target_velocity.X / movementdivisor) - vel.X) * (PID_D / 6); | 996 | vec.X = ((_target_velocity.X / movementdivisor) - vel.X) * (PID_D / 6); |
997 | vec.Y = ((_target_velocity.Y / movementdivisor) - vel.Y) * (PID_D / 6); | 997 | vec.Y = ((_target_velocity.Y / movementdivisor) - vel.Y) * (PID_D / 6); |
998 | |||
999 | // m_log.DebugFormat( | ||
1000 | // "[ODE CHARACTER]: !m_iscolliding && flying, vec {0}, _target_velocity {1}, movementdivisor {2}, vel {3}", | ||
1001 | // vec, _target_velocity, movementdivisor, vel); | ||
998 | } | 1002 | } |
999 | 1003 | ||
1000 | if (m_iscolliding && !flying && _target_velocity.Z > 0.0f) | 1004 | if (m_iscolliding && !flying && _target_velocity.Z > 0.0f) |
@@ -1020,11 +1024,11 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1020 | // d.Vector3 pos = d.BodyGetPosition(Body); | 1024 | // d.Vector3 pos = d.BodyGetPosition(Body); |
1021 | if (_target_velocity.X > 0) | 1025 | if (_target_velocity.X > 0) |
1022 | { | 1026 | { |
1023 | vec.X = ((_target_velocity.X - vel.X)/1.2f)*PID_D; | 1027 | vec.X = ((_target_velocity.X - vel.X) / 1.2f) * PID_D; |
1024 | } | 1028 | } |
1025 | if (_target_velocity.Y > 0) | 1029 | if (_target_velocity.Y > 0) |
1026 | { | 1030 | { |
1027 | vec.Y = ((_target_velocity.Y - vel.Y)/1.2f)*PID_D; | 1031 | vec.Y = ((_target_velocity.Y - vel.Y) / 1.2f) * PID_D; |
1028 | } | 1032 | } |
1029 | } | 1033 | } |
1030 | 1034 | ||
@@ -1167,7 +1171,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1167 | /// <summary> | 1171 | /// <summary> |
1168 | /// Used internally to destroy the ODE structures associated with this character. | 1172 | /// Used internally to destroy the ODE structures associated with this character. |
1169 | /// </summary> | 1173 | /// </summary> |
1170 | public void DestroyOdeStructures() | 1174 | private void DestroyOdeStructures() |
1171 | { | 1175 | { |
1172 | // destroy avatar capsule and related ODE data | 1176 | // destroy avatar capsule and related ODE data |
1173 | if (Amotor != IntPtr.Zero) | 1177 | if (Amotor != IntPtr.Zero) |