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)
return;
m_cureventsubscription = 0;
int ncolisions = CollisionEventsThisFrame.m_objCollisionList.Count;
if (!SentEmptyCollisionsEvent || ncolisions > 0)
{
base.SendCollisionUpdate(CollisionEventsThisFrame);
m_cureventsubscription = 0;
if (ncolisions == 0)
{
SentEmptyCollisionsEvent = true;
_parent_scene.RemoveCollisionEventReporting(this);
// _parent_scene.RemoveCollisionEventReporting(this);
}
else
{

View File

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