diff options
author | UbitUmarov | 2012-04-16 17:47:17 +0100 |
---|---|---|
committer | UbitUmarov | 2012-04-16 17:47:17 +0100 |
commit | fff5c61ae83ad54eaff640d2868186d275f3dd62 (patch) | |
tree | 6f1253dfe281bdd6940b47bb9529f351dae90489 /OpenSim/Region/Physics | |
parent | chODE bug fix (diff) | |
download | opensim-SC_OLD-fff5c61ae83ad54eaff640d2868186d275f3dd62.zip opensim-SC_OLD-fff5c61ae83ad54eaff640d2868186d275f3dd62.tar.gz opensim-SC_OLD-fff5c61ae83ad54eaff640d2868186d275f3dd62.tar.bz2 opensim-SC_OLD-fff5c61ae83ad54eaff640d2868186d275f3dd62.tar.xz |
chODE: if character velocity > 50m/s apply breaks. In free fall this will give a terminal velocity +- 60m/s
Diffstat (limited to 'OpenSim/Region/Physics')
-rw-r--r-- | OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs index c53ccec..ec717d7 100644 --- a/OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs | |||
@@ -1122,9 +1122,18 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1122 | } | 1122 | } |
1123 | // end add Kitto Flora | 1123 | // end add Kitto Flora |
1124 | } | 1124 | } |
1125 | |||
1126 | if (vel.X * vel.X + vel.Y * vel.Y + vel.Z * vel.Z > 2500.0f) // 50ms apply breaks | ||
1127 | { | ||
1128 | float breakfactor = 0.16f * m_mass; // will give aprox 60m/s terminal velocity at free fall | ||
1129 | vec.X -= breakfactor * vel.X; | ||
1130 | vec.Y -= breakfactor * vel.Y; | ||
1131 | vec.Z -= breakfactor * vel.Z; | ||
1132 | } | ||
1133 | |||
1125 | if (vec.IsFinite()) | 1134 | if (vec.IsFinite()) |
1126 | { | 1135 | { |
1127 | if (!vec.ApproxEquals(Vector3.Zero, 0.02f)) // 0.01 allows 0.002 !! | 1136 | if (vec.LengthSquared() > 0.0004f) // 0.01 allows 0.002 !! |
1128 | { | 1137 | { |
1129 | //Console.WriteLine("DF 2"); // ## | 1138 | //Console.WriteLine("DF 2"); // ## |
1130 | 1139 | ||