ubOde reduce collision_start latency in same cases (only one collision happening and more than 50ms since last)

LSLKeyTest
UbitUmarov 2016-08-17 22:34:21 +01:00
parent bca5fd98dc
commit f1495cb237
2 changed files with 8 additions and 10 deletions

View File

@ -1605,18 +1605,17 @@ namespace OpenSim.Region.PhysicsModule.ubOde
if (m_cureventsubscription < m_eventsubscription) if (m_cureventsubscription < m_eventsubscription)
return; return;
m_cureventsubscription = 0;
int ncolisions = CollisionEventsThisFrame.m_objCollisionList.Count; int ncolisions = CollisionEventsThisFrame.m_objCollisionList.Count;
if (!SentEmptyCollisionsEvent || ncolisions > 0) if (!SentEmptyCollisionsEvent || ncolisions > 0)
{ {
base.SendCollisionUpdate(CollisionEventsThisFrame); base.SendCollisionUpdate(CollisionEventsThisFrame);
m_cureventsubscription = 0;
if (ncolisions == 0) if (ncolisions == 0)
{ {
SentEmptyCollisionsEvent = true; SentEmptyCollisionsEvent = true;
_parent_scene.RemoveCollisionEventReporting(this); // _parent_scene.RemoveCollisionEventReporting(this);
} }
else else
{ {

View File

@ -1000,9 +1000,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde
public override void AddCollisionEvent(uint CollidedWith, ContactPoint contact) public override void AddCollisionEvent(uint CollidedWith, ContactPoint contact)
{ {
if (CollisionEventsThisFrame == null) if (CollisionEventsThisFrame == null)
CollisionEventsThisFrame = new CollisionEventUpdate(); CollisionEventsThisFrame = new CollisionEventUpdate();
CollisionEventsThisFrame.AddCollider(CollidedWith, contact); CollisionEventsThisFrame.AddCollider(CollidedWith, contact);
_parent_scene.AddCollisionEventReporting(this); _parent_scene.AddCollisionEventReporting(this);
} }
@ -1033,21 +1033,20 @@ namespace OpenSim.Region.PhysicsModule.ubOde
if (CollisionEventsThisFrame == null) if (CollisionEventsThisFrame == null)
return; return;
int ncolisions = CollisionEventsThisFrame.m_objCollisionList.Count;
if (m_cureventsubscription < m_eventsubscription) if (m_cureventsubscription < m_eventsubscription)
return; return;
m_cureventsubscription = 0;
int ncolisions = CollisionEventsThisFrame.m_objCollisionList.Count;
if (!SentEmptyCollisionsEvent || ncolisions > 0) if (!SentEmptyCollisionsEvent || ncolisions > 0)
{ {
base.SendCollisionUpdate(CollisionEventsThisFrame); base.SendCollisionUpdate(CollisionEventsThisFrame);
m_cureventsubscription = 0;
if (ncolisions == 0) if (ncolisions == 0)
{ {
SentEmptyCollisionsEvent = true; SentEmptyCollisionsEvent = true;
_parent_scene.RemoveCollisionEventReporting(this); // _parent_scene.RemoveCollisionEventReporting(this);
} }
else if(Body == IntPtr.Zero || d.BodyIsEnabled(Body)) else if(Body == IntPtr.Zero || d.BodyIsEnabled(Body))
{ {