diff options
author | UbitUmarov | 2014-10-12 01:14:54 +0100 |
---|---|---|
committer | UbitUmarov | 2014-10-12 01:14:54 +0100 |
commit | 10d3d0c81de69106cd0a4f4a6d4f94310f595f43 (patch) | |
tree | be54dca4647baae94001fb6f45b9ab7e55ea2dfc | |
parent | add simulator features AvatarSkeleton and AnimationSet report (diff) | |
download | opensim-SC_OLD-10d3d0c81de69106cd0a4f4a6d4f94310f595f43.zip opensim-SC_OLD-10d3d0c81de69106cd0a4f4a6d4f94310f595f43.tar.gz opensim-SC_OLD-10d3d0c81de69106cd0a4f4a6d4f94310f595f43.tar.bz2 opensim-SC_OLD-10d3d0c81de69106cd0a4f4a6d4f94310f595f43.tar.xz |
try to reduce avatar bounce on falls. Not all possible side effects
checked, specially on portals
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs | 44 |
1 files changed, 19 insertions, 25 deletions
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs index af7ca1d..1c38246 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs | |||
@@ -311,9 +311,9 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
311 | { | 311 | { |
312 | if (value) | 312 | if (value) |
313 | { | 313 | { |
314 | m_colliderfilter += 2; | 314 | m_colliderfilter += 3; |
315 | if (m_colliderfilter > 2) | 315 | if (m_colliderfilter > 3) |
316 | m_colliderfilter = 2; | 316 | m_colliderfilter = 3; |
317 | } | 317 | } |
318 | else | 318 | else |
319 | { | 319 | { |
@@ -328,6 +328,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
328 | { | 328 | { |
329 | m_pidControllerActive = true; | 329 | m_pidControllerActive = true; |
330 | m_iscolliding = true; | 330 | m_iscolliding = true; |
331 | m_freemove = false; | ||
331 | } | 332 | } |
332 | } | 333 | } |
333 | } | 334 | } |
@@ -928,19 +929,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
928 | IsColliding = true; | 929 | IsColliding = true; |
929 | } | 930 | } |
930 | } | 931 | } |
931 | /* | ||
932 | if (contact.normal.Z < 0.2f) | ||
933 | { | ||
934 | contact.normal.Z = 0; | ||
935 | float t = contact.normal.X * contact.normal.X + contact.normal.Y * contact.normal.Y; | ||
936 | if (t > 0) | ||
937 | { | ||
938 | t = 1.0f / t; | ||
939 | contact.normal.X *= t; | ||
940 | contact.normal.Y *= t; | ||
941 | } | ||
942 | } | ||
943 | */ | ||
944 | return true; | 932 | return true; |
945 | } | 933 | } |
946 | 934 | ||
@@ -1204,12 +1192,18 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1204 | // Avatar to Avatar collisions | 1192 | // Avatar to Avatar collisions |
1205 | // Prim to avatar collisions | 1193 | // Prim to avatar collisions |
1206 | 1194 | ||
1207 | vec.X = -vel.X * PID_D + (_zeroPosition.X - localpos.X) * (PID_P * 5); | 1195 | vec.X = -vel.X * PID_D * 2f + (_zeroPosition.X - localpos.X) * (PID_P * 5); |
1208 | vec.Y = -vel.Y * PID_D + (_zeroPosition.Y - localpos.Y) * (PID_P * 5); | 1196 | vec.Y = -vel.Y * PID_D * 2f + (_zeroPosition.Y - localpos.Y) * (PID_P * 5); |
1197 | if(vel.Z > 0) | ||
1198 | vec.Z += -vel.Z * PID_D + (_zeroPosition.Z - localpos.Z) * PID_P; | ||
1199 | else | ||
1200 | vec.Z += (-vel.Z * PID_D + (_zeroPosition.Z - localpos.Z) * PID_P) * 0.2f; | ||
1201 | /* | ||
1209 | if (flying) | 1202 | if (flying) |
1210 | { | 1203 | { |
1211 | vec.Z += -vel.Z * PID_D + (_zeroPosition.Z - localpos.Z) * PID_P; | 1204 | vec.Z += -vel.Z * PID_D + (_zeroPosition.Z - localpos.Z) * PID_P; |
1212 | } | 1205 | } |
1206 | */ | ||
1213 | } | 1207 | } |
1214 | //PidStatus = true; | 1208 | //PidStatus = true; |
1215 | } | 1209 | } |
@@ -1226,7 +1220,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1226 | if (ctz.Z > 0f) | 1220 | if (ctz.Z > 0f) |
1227 | { | 1221 | { |
1228 | // moving up or JUMPING | 1222 | // moving up or JUMPING |
1229 | vec.Z += (ctz.Z - vel.Z) * PID_D; | 1223 | vec.Z += (ctz.Z - vel.Z) * PID_D * 2f; |
1230 | vec.X += (ctz.X - vel.X) * (PID_D); | 1224 | vec.X += (ctz.X - vel.X) * (PID_D); |
1231 | vec.Y += (ctz.Y - vel.Y) * (PID_D); | 1225 | vec.Y += (ctz.Y - vel.Y) * (PID_D); |
1232 | } | 1226 | } |
@@ -1236,7 +1230,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1236 | if (ctz.Z == 0) | 1230 | if (ctz.Z == 0) |
1237 | { | 1231 | { |
1238 | if (vel.Z > 0) | 1232 | if (vel.Z > 0) |
1239 | vec.Z -= vel.Z * PID_D; | 1233 | vec.Z -= vel.Z * PID_D * 2f; |
1240 | vec.X += (ctz.X - vel.X) * (PID_D); | 1234 | vec.X += (ctz.X - vel.X) * (PID_D); |
1241 | vec.Y += (ctz.Y - vel.Y) * (PID_D); | 1235 | vec.Y += (ctz.Y - vel.Y) * (PID_D); |
1242 | } | 1236 | } |
@@ -1305,9 +1299,9 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1305 | vec.X -= breakfactor * vel.X; | 1299 | vec.X -= breakfactor * vel.X; |
1306 | vec.Y -= breakfactor * vel.Y; | 1300 | vec.Y -= breakfactor * vel.Y; |
1307 | if (flying) | 1301 | if (flying) |
1308 | vec.Z -= breakfactor * vel.Z; | 1302 | vec.Z -= 0.5f * breakfactor * vel.Z; |
1309 | else | 1303 | else |
1310 | vec.Z -= .5f* m_mass * vel.Z; | 1304 | vec.Z -= .16f* m_mass * vel.Z; |
1311 | } | 1305 | } |
1312 | 1306 | ||
1313 | if (flying) | 1307 | if (flying) |
@@ -1687,9 +1681,9 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1687 | _zeroFlag = false; | 1681 | _zeroFlag = false; |
1688 | _target_velocity = Vector3.Zero; | 1682 | _target_velocity = Vector3.Zero; |
1689 | m_freemove = true; | 1683 | m_freemove = true; |
1690 | m_colliderfilter = -2; | 1684 | m_colliderfilter = -1; |
1691 | m_colliderObjectfilter = -2; | 1685 | m_colliderObjectfilter = -1; |
1692 | m_colliderGroundfilter = -2; | 1686 | m_colliderGroundfilter = -1; |
1693 | 1687 | ||
1694 | m_iscolliding = false; | 1688 | m_iscolliding = false; |
1695 | m_iscollidingGround = false; | 1689 | m_iscollidingGround = false; |