Fixed the fix for frustum culling. Thansk to vitek for pointing me on this.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@670 dfc29bdd-3216-0410-991c-e03cc46cb475
master
hybrid 2007-05-29 22:24:58 +00:00
parent 0760b479db
commit 6c63b2f889
1 changed files with 5 additions and 7 deletions

View File

@ -839,19 +839,17 @@ bool CSceneManager::isCulled(ISceneNode* node)
for (s32 i=0; i<scene::SViewFrustum::VF_PLANE_COUNT; ++i)
{
u32 inFrustum=0, outFrustum=0;
for (u32 j=0; (j<8) && (inFrustum==0 || outFrustum==0); ++j)
bool pointInFrustum=false, pointOutsideFrustum=false;
for (u32 j=0; (j<8) && (!pointInFrustum || !pointOutsideFrustum); ++j)
{
if (frust.planes[i].classifyPointRelation(edges[j]) != core::ISREL3D_FRONT)
++inFrustum;
pointInFrustum=true;
else
++outFrustum;
pointOutsideFrustum=true;
}
if (inFrustum==0)
if (!pointInFrustum)
return true;
else if (outFrustum)
return false;
}
return false;