From 713287707595061d7ce343db73edf3462d2d29fc Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Thu, 29 Oct 2009 01:46:58 -0700 Subject: * Log progress messages when loading OAR files with a lot of assets * Change the PhysicsCollision callback for objects to send full contact point information. This will be used to calculate the collision plane for avatars * Send the physics engine velocity in terse updates, not the current force being applied to the avatar. This should fix several issues including crouching through the floor and walking through walls --- OpenSim/Region/Physics/Manager/PhysicsActor.cs | 29 +++++++++++++++++++------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/Physics/Manager/PhysicsActor.cs') diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index 6bfdff2..f58129d 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs @@ -52,6 +52,20 @@ namespace OpenSim.Region.Physics.Manager , Absolute } + public struct ContactPoint + { + public Vector3 Position; + public Vector3 SurfaceNormal; + public float PenetrationDepth; + + public ContactPoint(Vector3 position, Vector3 surfaceNormal, float penetrationDepth) + { + Position = position; + SurfaceNormal = surfaceNormal; + PenetrationDepth = penetrationDepth; + } + } + public class CollisionEventUpdate : EventArgs { // Raising the event on the object, so don't need to provide location.. further up the tree knows that info. @@ -59,9 +73,9 @@ namespace OpenSim.Region.Physics.Manager public int m_colliderType; public int m_GenericStartEnd; //public uint m_LocalID; - public Dictionary m_objCollisionList = new Dictionary(); + public Dictionary m_objCollisionList = new Dictionary(); - public CollisionEventUpdate(uint localID, int colliderType, int GenericStartEnd, Dictionary objCollisionList) + public CollisionEventUpdate(uint localID, int colliderType, int GenericStartEnd, Dictionary objCollisionList) { m_colliderType = colliderType; m_GenericStartEnd = GenericStartEnd; @@ -72,8 +86,7 @@ namespace OpenSim.Region.Physics.Manager { m_colliderType = (int) ActorTypes.Unknown; m_GenericStartEnd = 1; - // m_objCollisionList = null; - m_objCollisionList = new Dictionary(); + m_objCollisionList = new Dictionary(); } public int collidertype @@ -88,16 +101,16 @@ namespace OpenSim.Region.Physics.Manager set { m_GenericStartEnd = value; } } - public void addCollider(uint localID, float depth) + public void addCollider(uint localID, ContactPoint contact) { if (!m_objCollisionList.ContainsKey(localID)) { - m_objCollisionList.Add(localID, depth); + m_objCollisionList.Add(localID, contact); } else { - if (m_objCollisionList[localID] < depth) - m_objCollisionList[localID] = depth; + if (m_objCollisionList[localID].PenetrationDepth < contact.PenetrationDepth) + m_objCollisionList[localID] = contact; } } } -- cgit v1.1