Commit ae552a7d authored by hybrid's avatar hybrid

Reverted the frstum culling test to the old one which was fine, except for the...

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-e03cc46cb475
parent 6c63b2f8
...@@ -839,16 +839,14 @@ bool CSceneManager::isCulled(ISceneNode* node) ...@@ -839,16 +839,14 @@ 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)
{ {
bool pointInFrustum=false, pointOutsideFrustum=false; bool boxInFrustum=false;
for (u32 j=0; (j<8) && (!pointInFrustum || !pointOutsideFrustum); ++j) for (u32 j=0; j<8; ++j)
{ {
if (frust.planes[i].classifyPointRelation(edges[j]) != core::ISREL3D_FRONT) if (frust.planes[i].classifyPointRelation(edges[j]) != core::ISREL3D_FRONT)
pointInFrustum=true; boxInFrustum=true;
else
pointOutsideFrustum=true;
} }
if (!pointInFrustum) if (!boxInFrustum)
return true; return true;
} }
......
...@@ -307,18 +307,17 @@ private: ...@@ -307,18 +307,17 @@ private:
for (i=0; i<scene::SViewFrustum::VF_PLANE_COUNT; ++i) 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) for (int j=0; j<8; ++j)
if (frustum.planes[i].classifyPointRelation(edges[j]) != core::ISREL3D_FRONT) if (frustum.planes[i].classifyPointRelation(edges[j]) != core::ISREL3D_FRONT)
++inFrustum; {
else boxInFrustum=true;
++outFrustum; break;
}
if (!inFrustum) // all edges outside if (!inFrustum) // all edges outside
return; return;
else if (outFrustum) // intersection of plane
break;
} }
} }
......
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