aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/Manager/PhysicsActor.cs
diff options
context:
space:
mode:
authorJohn Hurliman2009-10-29 01:46:58 -0700
committerJohn Hurliman2009-10-29 01:46:58 -0700
commit713287707595061d7ce343db73edf3462d2d29fc (patch)
treea70f73db1603cf233893645293ca0a0ca715c4cb /OpenSim/Region/Physics/Manager/PhysicsActor.cs
parentSmall performance tweaks to code called by the heartbeat loop (diff)
downloadopensim-SC_OLD-713287707595061d7ce343db73edf3462d2d29fc.zip
opensim-SC_OLD-713287707595061d7ce343db73edf3462d2d29fc.tar.gz
opensim-SC_OLD-713287707595061d7ce343db73edf3462d2d29fc.tar.bz2
opensim-SC_OLD-713287707595061d7ce343db73edf3462d2d29fc.tar.xz
* 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
Diffstat (limited to 'OpenSim/Region/Physics/Manager/PhysicsActor.cs')
-rw-r--r--OpenSim/Region/Physics/Manager/PhysicsActor.cs29
1 files changed, 21 insertions, 8 deletions
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
52 , Absolute 52 , Absolute
53 } 53 }
54 54
55 public struct ContactPoint
56 {
57 public Vector3 Position;
58 public Vector3 SurfaceNormal;
59 public float PenetrationDepth;
60
61 public ContactPoint(Vector3 position, Vector3 surfaceNormal, float penetrationDepth)
62 {
63 Position = position;
64 SurfaceNormal = surfaceNormal;
65 PenetrationDepth = penetrationDepth;
66 }
67 }
68
55 public class CollisionEventUpdate : EventArgs 69 public class CollisionEventUpdate : EventArgs
56 { 70 {
57 // Raising the event on the object, so don't need to provide location.. further up the tree knows that info. 71 // 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
59 public int m_colliderType; 73 public int m_colliderType;
60 public int m_GenericStartEnd; 74 public int m_GenericStartEnd;
61 //public uint m_LocalID; 75 //public uint m_LocalID;
62 public Dictionary<uint,float> m_objCollisionList = new Dictionary<uint,float>(); 76 public Dictionary<uint, ContactPoint> m_objCollisionList = new Dictionary<uint, ContactPoint>();
63 77
64 public CollisionEventUpdate(uint localID, int colliderType, int GenericStartEnd, Dictionary<uint, float> objCollisionList) 78 public CollisionEventUpdate(uint localID, int colliderType, int GenericStartEnd, Dictionary<uint, ContactPoint> objCollisionList)
65 { 79 {
66 m_colliderType = colliderType; 80 m_colliderType = colliderType;
67 m_GenericStartEnd = GenericStartEnd; 81 m_GenericStartEnd = GenericStartEnd;
@@ -72,8 +86,7 @@ namespace OpenSim.Region.Physics.Manager
72 { 86 {
73 m_colliderType = (int) ActorTypes.Unknown; 87 m_colliderType = (int) ActorTypes.Unknown;
74 m_GenericStartEnd = 1; 88 m_GenericStartEnd = 1;
75 // m_objCollisionList = null; 89 m_objCollisionList = new Dictionary<uint, ContactPoint>();
76 m_objCollisionList = new Dictionary<uint, float>();
77 } 90 }
78 91
79 public int collidertype 92 public int collidertype
@@ -88,16 +101,16 @@ namespace OpenSim.Region.Physics.Manager
88 set { m_GenericStartEnd = value; } 101 set { m_GenericStartEnd = value; }
89 } 102 }
90 103
91 public void addCollider(uint localID, float depth) 104 public void addCollider(uint localID, ContactPoint contact)
92 { 105 {
93 if (!m_objCollisionList.ContainsKey(localID)) 106 if (!m_objCollisionList.ContainsKey(localID))
94 { 107 {
95 m_objCollisionList.Add(localID, depth); 108 m_objCollisionList.Add(localID, contact);
96 } 109 }
97 else 110 else
98 { 111 {
99 if (m_objCollisionList[localID] < depth) 112 if (m_objCollisionList[localID].PenetrationDepth < contact.PenetrationDepth)
100 m_objCollisionList[localID] = depth; 113 m_objCollisionList[localID] = contact;
101 } 114 }
102 } 115 }
103 } 116 }