Octree.cpp
// Counts the number of cubes we have (triangulation support)
Counts the number of cubes we have (triangulation support)
Counts the number of cubes we have ( triangulation support )
int Octree::RecursiveCubeCount(OctreeNode *pCurrentNode)
{
    int subCount = 0;
    if (pCurrentNode->nodeData.hasConsensus && pCurrentNode->nodeData.isFilled)
    {
        return 1;
    }
    else if (pCurrentNode->nodeData.hasConsensus)
    {
        return 0;
    }
    for (int i = 0; i < OCTANT_COUNT; i++)
    {
        bool nullIsFilled = pCurrentNode->nodeData.isFilled;
        if (pCurrentNode->miniCubes[i] == nullptr && nullIsFilled)
        {
            ++subCount;
        }
        else if (pCurrentNode->miniCubes[i] != nullptr)
        {
            subCount += RecursiveCubeCount(pCurrentNode->miniCubes[i]);
        }
    }
    return subCount;
}
int Octree :: RecursiveCubeCount ( OctreeNode * pCurrentNode ) { int subCount = 0 ; if ( pCurrentNode -> nodeData . hasConsensus && pCurrentNode -> nodeData . isFilled ) { return 1 ; } else if ( pCurrentNode -> nodeData . hasConsensus ) { return 0 ; } for ( int i = 0 ; i < OCTANT_COUNT ; i ++ ) { bool nullIsFilled = pCurrentNode -> nodeData . isFilled ; if ( pCurrentNode -> miniCubes [ i ] == nullptr && nullIsFilled ) { ++ subCount ; } else if ( pCurrentNode -> miniCubes [ i ] != nullptr ) { subCount += RecursiveCubeCount ( pCurrentNode -> miniCubes [ i ] ) ; } } return subCount ; }
Counts the number of cubes we have (triangulation support)
Counts the number of cubes we have ( triangulation support )
// Completely filled space // Empty space, no cubes here // Partially filled space