If OdeScene.Near() returns no collision contacts, then exit as early as possible. All subsequent code is only relevant if there are contacts.

0.7.4.1
Justin Clark-Casey (justincc) 2012-06-01 04:07:39 +01:00
parent 200376b3c4
commit 4e06a46dc5
1 changed files with 4 additions and 0 deletions

View File

@ -1025,6 +1025,10 @@ namespace OpenSim.Region.Physics.OdePlugin
count = CollideGeoms(g1, g2, contacts.Length, contacts, d.ContactGeom.SizeOf); count = CollideGeoms(g1, g2, contacts.Length, contacts, d.ContactGeom.SizeOf);
// All code after this is only relevant if we have any collisions
if (count <= 0)
return;
if (count > contacts.Length) if (count > contacts.Length)
m_log.Error("[ODE SCENE]: Got " + count + " contacts when we asked for a maximum of " + contacts.Length); m_log.Error("[ODE SCENE]: Got " + count + " contacts when we asked for a maximum of " + contacts.Length);
} }