Commit d232810c authored by Rogerborg's avatar Rogerborg

Last fix to https://sourceforge.net/tracker2/?func=detail&aid=2473520&group_id=74339&atid=540676

Last fix to CSceneCollisionManager::getPickedNodeBB(). ;)  Efficiency improvements to reduce the number of checks, since we can only hit one face of each box, and we needn't consider boxes that are further away than the closest hit.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2049 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 2b18db4c
......@@ -157,7 +157,7 @@ void CSceneCollisionManager::getPickedNodeBB(ISceneNode* root,
core::plane3df facePlane;
bool gotHit = false;
for(s32 face = 0; face < 6; ++face)
for(s32 face = 0; face < 6 && !gotHit; ++face)
{
facePlane.setPlane(edges[faceEdges[face][0]],
edges[faceEdges[face][1]],
......@@ -187,6 +187,9 @@ void CSceneCollisionManager::getPickedNodeBB(ISceneNode* root,
{
outbestdistance = toIntersectionSq;
outbestnode = current;
// We can only hit one face, so stop checking now.
gotHit = true;
}
}
}
......
Test suite pass at GMT Tue Jan 06 15:37:52 2009
Test suite pass at GMT Tue Jan 06 15:45:40 2009
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment