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-e03cc46cb475master
parent
0760b479db
commit
6c63b2f889
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue