Commit 6c63b2f8 authored by hybrid's avatar hybrid

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