aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorteravus2013-05-14 20:55:56 -0400
committerteravus2013-05-14 20:55:56 -0400
commit477a5e3a35780809b1807e43f6deed8ede17f14d (patch)
tree441f4919270fab47da69112261632f22b140fb02 /OpenSim/Region
parent* Tweaks the hard cut to apply to collisions of Greater then Normal Z 0.95. ... (diff)
downloadopensim-SC-477a5e3a35780809b1807e43f6deed8ede17f14d.zip
opensim-SC-477a5e3a35780809b1807e43f6deed8ede17f14d.tar.gz
opensim-SC-477a5e3a35780809b1807e43f6deed8ede17f14d.tar.bz2
opensim-SC-477a5e3a35780809b1807e43f6deed8ede17f14d.tar.xz
* This fixes the avatar stuck in objects on login and teleport by gently applying an upward motion when stuck in things on the Z
* Comments describe how it filters out good, normal collisions, from 'stuck' collisions.. It's especially sensitive in feetbox collisions since this is where normal collisions happen under usual circumstances.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs12
1 files changed, 12 insertions, 0 deletions
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs
index 238e6e9..e912997 100644
--- a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs
@@ -1097,8 +1097,20 @@ namespace OpenSim.Region.Physics.OdePlugin
1097 { 1097 {
1098 float h = contact.pos.Z - _position.Z; 1098 float h = contact.pos.Z - _position.Z;
1099 1099
1100 // Only do this if the normal is sufficiently pointing in the 'up' direction
1100 if (Math.Abs(contact.normal.Z) > 0.95f) 1101 if (Math.Abs(contact.normal.Z) > 0.95f)
1101 { 1102 {
1103 // We Only want to do this if we're sunk into the object a bit and we're stuck and we're trying to move and feetcollision is false
1104 if ((contact.depth > 0.0010f && _velocity.X == 0f && _velocity.Y == 0 && _velocity.Z == 0)
1105 && (_target_velocity.X > 0 || _target_velocity.Y > 0 || _target_velocity.Z > 0)
1106 && (!feetcollision) )
1107 {
1108 m_collisionException = true; // Stop looping, do this only once not X times Contacts
1109 _position.Z += contact.depth + 0.01f; // Move us Up the amount that we sank in, and add 0.01 meters to gently lift avatar up.
1110
1111 return true;
1112 }
1113
1102 if (contact.normal.Z > 0) 1114 if (contact.normal.Z > 0)
1103 contact.normal.Z = 1.0f; 1115 contact.normal.Z = 1.0f;
1104 else 1116 else