couldn't work out why oct-trees were culled against the bounding box of the frustum rather than the frustum itself. works better than the bounding box method in my test meshes (box method culls too much) so I changed it back to use frustum method.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@705 dfc29bdd-3216-0410-991c-e03cc46cb475
master
bitplane 2007-06-10 20:02:11 +00:00
parent ef6f9fd006
commit 401a1e10ad
2 changed files with 10 additions and 7 deletions

View File

@ -113,16 +113,19 @@ void COctTreeSceneNode::render()
//transform the frustum to the current absolute transformation
core::matrix4 invTrans(AbsoluteTransformation);
invTrans.makeInverse();
frust.transform(invTrans);
/*
//frust.transform(invTrans);
//const core::aabbox3d<float> &box = frust.getBoundingBox();
*/
const core::aabbox3d<float> &box = frust.getBoundingBox();
frust.transform(invTrans);
switch(vertexType)
{
case video::EVT_STANDARD:
{
StdOctTree->calculatePolys(box);
//StdOctTree->calculatePolys(frust);
//StdOctTree->calculatePolys(box);
StdOctTree->calculatePolys(frust);
OctTree<video::S3DVertex>::SIndexData* d = StdOctTree->getIndexData();
@ -168,8 +171,8 @@ void COctTreeSceneNode::render()
}
case video::EVT_2TCOORDS:
{
LightMapOctTree->calculatePolys(box);
//LightMapOctTree->calculatePolys(frust);
//LightMapOctTree->calculatePolys(box);
LightMapOctTree->calculatePolys(frust);
OctTree<video::S3DVertex2TCoords>::SIndexData* d = LightMapOctTree->getIndexData();

View File

@ -95,7 +95,7 @@ public:
for (u32 i=0; i<IndexDataCount; ++i)
IndexData[i].CurrentSize = 0;
Root->getPolys(frustum, IndexData);
Root->getPolys(frustum, IndexData, 0);
}