Reverted the frstum culling test to the old one which was fine, except for the wrong usage of isFrontFacing...
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@671 dfc29bdd-3216-0410-991c-e03cc46cb475master
parent
6c63b2f889
commit
ae552a7d44
|
@ -839,16 +839,14 @@ bool CSceneManager::isCulled(ISceneNode* node)
|
|||
|
||||
for (s32 i=0; i<scene::SViewFrustum::VF_PLANE_COUNT; ++i)
|
||||
{
|
||||
bool pointInFrustum=false, pointOutsideFrustum=false;
|
||||
for (u32 j=0; (j<8) && (!pointInFrustum || !pointOutsideFrustum); ++j)
|
||||
bool boxInFrustum=false;
|
||||
for (u32 j=0; j<8; ++j)
|
||||
{
|
||||
if (frust.planes[i].classifyPointRelation(edges[j]) != core::ISREL3D_FRONT)
|
||||
pointInFrustum=true;
|
||||
else
|
||||
pointOutsideFrustum=true;
|
||||
boxInFrustum=true;
|
||||
}
|
||||
|
||||
if (!pointInFrustum)
|
||||
if (!boxInFrustum)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -307,18 +307,17 @@ private:
|
|||
|
||||
for (i=0; i<scene::SViewFrustum::VF_PLANE_COUNT; ++i)
|
||||
{
|
||||
u32 inFrustum=0, outFrustum=0;
|
||||
bool boxInFrustum=false;
|
||||
|
||||
for (int j=0; j<8; ++j)
|
||||
if (frustum.planes[i].classifyPointRelation(edges[j]) != core::ISREL3D_FRONT)
|
||||
++inFrustum;
|
||||
else
|
||||
++outFrustum;
|
||||
{
|
||||
boxInFrustum=true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!inFrustum) // all edges outside
|
||||
return;
|
||||
else if (outFrustum) // intersection of plane
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue