ubOde reduce collision_start latency in same cases (only one collision happening and more than 50ms since last)
parent
bca5fd98dc
commit
f1495cb237
|
@ -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
|
||||||
{
|
{
|
||||||
|
|
|
@ -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,28 +1033,27 @@ 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))
|
||||||
{
|
{
|
||||||
SentEmptyCollisionsEvent = false;
|
SentEmptyCollisionsEvent = false;
|
||||||
CollisionEventsThisFrame.Clear();
|
CollisionEventsThisFrame.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool SubscribedEvents()
|
public override bool SubscribedEvents()
|
||||||
|
|
Loading…
Reference in New Issue