aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/PhysicsModules/ubOde
diff options
context:
space:
mode:
authorUbitUmarov2016-08-17 22:34:21 +0100
committerUbitUmarov2016-08-17 22:34:21 +0100
commitf1495cb237d23955a3bba32d9c6978bca4943026 (patch)
tree1b8249d73e03f9d3b121d4008b4af51a5553f5b1 /OpenSim/Region/PhysicsModules/ubOde
parent remove some dead code (diff)
downloadopensim-SC-f1495cb237d23955a3bba32d9c6978bca4943026.zip
opensim-SC-f1495cb237d23955a3bba32d9c6978bca4943026.tar.gz
opensim-SC-f1495cb237d23955a3bba32d9c6978bca4943026.tar.bz2
opensim-SC-f1495cb237d23955a3bba32d9c6978bca4943026.tar.xz
ubOde reduce collision_start latency in same cases (only one collision happening and more than 50ms since last)
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs5
-rw-r--r--OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs13
2 files changed, 8 insertions, 10 deletions
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs b/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs
index cef7063..c9489d2 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs
@@ -1605,18 +1605,17 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1605 if (m_cureventsubscription < m_eventsubscription) 1605 if (m_cureventsubscription < m_eventsubscription)
1606 return; 1606 return;
1607 1607
1608 m_cureventsubscription = 0;
1609
1610 int ncolisions = CollisionEventsThisFrame.m_objCollisionList.Count; 1608 int ncolisions = CollisionEventsThisFrame.m_objCollisionList.Count;
1611 1609
1612 if (!SentEmptyCollisionsEvent || ncolisions > 0) 1610 if (!SentEmptyCollisionsEvent || ncolisions > 0)
1613 { 1611 {
1614 base.SendCollisionUpdate(CollisionEventsThisFrame); 1612 base.SendCollisionUpdate(CollisionEventsThisFrame);
1613 m_cureventsubscription = 0;
1615 1614
1616 if (ncolisions == 0) 1615 if (ncolisions == 0)
1617 { 1616 {
1618 SentEmptyCollisionsEvent = true; 1617 SentEmptyCollisionsEvent = true;
1619 _parent_scene.RemoveCollisionEventReporting(this); 1618// _parent_scene.RemoveCollisionEventReporting(this);
1620 } 1619 }
1621 else 1620 else
1622 { 1621 {
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
index 9f62644..6f2cbbe 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
@@ -1000,9 +1000,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1000 1000
1001 public override void AddCollisionEvent(uint CollidedWith, ContactPoint contact) 1001 public override void AddCollisionEvent(uint CollidedWith, ContactPoint contact)
1002 { 1002 {
1003
1004 if (CollisionEventsThisFrame == null) 1003 if (CollisionEventsThisFrame == null)
1005 CollisionEventsThisFrame = new CollisionEventUpdate(); 1004 CollisionEventsThisFrame = new CollisionEventUpdate();
1005
1006 CollisionEventsThisFrame.AddCollider(CollidedWith, contact); 1006 CollisionEventsThisFrame.AddCollider(CollidedWith, contact);
1007 _parent_scene.AddCollisionEventReporting(this); 1007 _parent_scene.AddCollisionEventReporting(this);
1008 } 1008 }
@@ -1033,28 +1033,27 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1033 if (CollisionEventsThisFrame == null) 1033 if (CollisionEventsThisFrame == null)
1034 return; 1034 return;
1035 1035
1036 int ncolisions = CollisionEventsThisFrame.m_objCollisionList.Count;
1037
1036 if (m_cureventsubscription < m_eventsubscription) 1038 if (m_cureventsubscription < m_eventsubscription)
1037 return; 1039 return;
1038 1040
1039 m_cureventsubscription = 0;
1040
1041 int ncolisions = CollisionEventsThisFrame.m_objCollisionList.Count;
1042
1043 if (!SentEmptyCollisionsEvent || ncolisions > 0) 1041 if (!SentEmptyCollisionsEvent || ncolisions > 0)
1044 { 1042 {
1045 base.SendCollisionUpdate(CollisionEventsThisFrame); 1043 base.SendCollisionUpdate(CollisionEventsThisFrame);
1044 m_cureventsubscription = 0;
1046 1045
1047 if (ncolisions == 0) 1046 if (ncolisions == 0)
1048 { 1047 {
1049 SentEmptyCollisionsEvent = true; 1048 SentEmptyCollisionsEvent = true;
1050 _parent_scene.RemoveCollisionEventReporting(this); 1049// _parent_scene.RemoveCollisionEventReporting(this);
1051 } 1050 }
1052 else if(Body == IntPtr.Zero || d.BodyIsEnabled(Body)) 1051 else if(Body == IntPtr.Zero || d.BodyIsEnabled(Body))
1053 { 1052 {
1054 SentEmptyCollisionsEvent = false; 1053 SentEmptyCollisionsEvent = false;
1055 CollisionEventsThisFrame.Clear(); 1054 CollisionEventsThisFrame.Clear();
1056 } 1055 }
1057 } 1056 }
1058 } 1057 }
1059 1058
1060 public override bool SubscribedEvents() 1059 public override bool SubscribedEvents()