aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs15
1 files changed, 11 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index bacc9c9..f5d609d 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3465,6 +3465,7 @@ namespace OpenSim.Region.Framework.Scenes
3465 ControllingClient.SendAgentAlertMessage("Physics is having a problem with your avatar. You may not be able to move until you relog.", true); 3465 ControllingClient.SendAgentAlertMessage("Physics is having a problem with your avatar. You may not be able to move until you relog.", true);
3466 } 3466 }
3467 3467
3468
3468 /// <summary> 3469 /// <summary>
3469 /// Event called by the physics plugin to tell the avatar about a collision. 3470 /// Event called by the physics plugin to tell the avatar about a collision.
3470 /// </summary> 3471 /// </summary>
@@ -3494,7 +3495,6 @@ namespace OpenSim.Region.Framework.Scenes
3494 CollisionEventUpdate collisionData = (CollisionEventUpdate)e; 3495 CollisionEventUpdate collisionData = (CollisionEventUpdate)e;
3495 Dictionary<uint, ContactPoint> coldata = collisionData.m_objCollisionList; 3496 Dictionary<uint, ContactPoint> coldata = collisionData.m_objCollisionList;
3496 3497
3497 CollisionPlane = Vector4.UnitW;
3498 3498
3499// // No collisions at all means we may be flying. Update always 3499// // No collisions at all means we may be flying. Update always
3500// // to make falling work 3500// // to make falling work
@@ -3504,6 +3504,8 @@ namespace OpenSim.Region.Framework.Scenes
3504// m_lastColCount = coldata.Count; 3504// m_lastColCount = coldata.Count;
3505// } 3505// }
3506 3506
3507 CollisionPlane = Vector4.UnitW;
3508
3507 if (coldata.Count != 0) 3509 if (coldata.Count != 0)
3508 { 3510 {
3509 switch (Animator.CurrentMovementAnimation) 3511 switch (Animator.CurrentMovementAnimation)
@@ -3517,17 +3519,22 @@ namespace OpenSim.Region.Framework.Scenes
3517 ContactPoint lowest; 3519 ContactPoint lowest;
3518 lowest.SurfaceNormal = Vector3.Zero; 3520 lowest.SurfaceNormal = Vector3.Zero;
3519 lowest.Position = Vector3.Zero; 3521 lowest.Position = Vector3.Zero;
3520 lowest.Position.Z = Single.NaN; 3522 lowest.Position.Z = float.MaxValue;
3521 3523
3522 foreach (ContactPoint contact in coldata.Values) 3524 foreach (ContactPoint contact in coldata.Values)
3523 { 3525 {
3524 if (Single.IsNaN(lowest.Position.Z) || contact.Position.Z < lowest.Position.Z) 3526
3527 if (contact.CharacterFeet && contact.Position.Z < lowest.Position.Z)
3525 { 3528 {
3526 lowest = contact; 3529 lowest = contact;
3527 } 3530 }
3528 } 3531 }
3529 3532
3530 CollisionPlane = new Vector4(-lowest.SurfaceNormal, -Vector3.Dot(lowest.Position, lowest.SurfaceNormal)); 3533 if (lowest.Position.Z != float.MaxValue)
3534 {
3535 lowest.SurfaceNormal = -lowest.SurfaceNormal;
3536 CollisionPlane = new Vector4(lowest.SurfaceNormal, Vector3.Dot(lowest.Position, lowest.SurfaceNormal));
3537 }
3531 } 3538 }
3532 break; 3539 break;
3533 } 3540 }