From 4e06a46dc5e6d0fb6a894932e706e4a01351ec64 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 1 Jun 2012 04:07:39 +0100 Subject: If OdeScene.Near() returns no collision contacts, then exit as early as possible. All subsequent code is only relevant if there are contacts. --- OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index 8590453..c26c9c5 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs @@ -1025,6 +1025,10 @@ namespace OpenSim.Region.Physics.OdePlugin 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) m_log.Error("[ODE SCENE]: Got " + count + " contacts when we asked for a maximum of " + contacts.Length); } -- cgit v1.1