From de3180a63ecb89971321b7dce60dd86703f87e6d Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 5 Dec 2012 23:19:18 +0000
Subject: avatar collision plane send to viewer is only relative to feet.
change avatar collider, just rounding the boxes, etc
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
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
ControllingClient.SendAgentAlertMessage("Physics is having a problem with your avatar. You may not be able to move until you relog.", true);
}
+
///
/// Event called by the physics plugin to tell the avatar about a collision.
///
@@ -3494,7 +3495,6 @@ namespace OpenSim.Region.Framework.Scenes
CollisionEventUpdate collisionData = (CollisionEventUpdate)e;
Dictionary coldata = collisionData.m_objCollisionList;
- CollisionPlane = Vector4.UnitW;
// // No collisions at all means we may be flying. Update always
// // to make falling work
@@ -3504,6 +3504,8 @@ namespace OpenSim.Region.Framework.Scenes
// m_lastColCount = coldata.Count;
// }
+ CollisionPlane = Vector4.UnitW;
+
if (coldata.Count != 0)
{
switch (Animator.CurrentMovementAnimation)
@@ -3517,17 +3519,22 @@ namespace OpenSim.Region.Framework.Scenes
ContactPoint lowest;
lowest.SurfaceNormal = Vector3.Zero;
lowest.Position = Vector3.Zero;
- lowest.Position.Z = Single.NaN;
+ lowest.Position.Z = float.MaxValue;
foreach (ContactPoint contact in coldata.Values)
{
- if (Single.IsNaN(lowest.Position.Z) || contact.Position.Z < lowest.Position.Z)
+
+ if (contact.CharacterFeet && contact.Position.Z < lowest.Position.Z)
{
lowest = contact;
}
}
- CollisionPlane = new Vector4(-lowest.SurfaceNormal, -Vector3.Dot(lowest.Position, lowest.SurfaceNormal));
+ if (lowest.Position.Z != float.MaxValue)
+ {
+ lowest.SurfaceNormal = -lowest.SurfaceNormal;
+ CollisionPlane = new Vector4(lowest.SurfaceNormal, Vector3.Dot(lowest.Position, lowest.SurfaceNormal));
+ }
}
break;
}
--
cgit v1.1