void CModelBspTree::drawNode( CModelBspTreeNode* node, XMFLOAT4 position ){ std::string planeStr = ""; if( node->planeType == EModelBspNodePlaneType_XY ) { planeStr = "XY "; position.x += node->fDistance; } else if( node->planeType == EModelBspNodePlaneType_XZ ) { planeStr = "XZ "; position.y += node->fDistance; } else if( node->planeType == EModelBspNodePlaneType_YZ ) { planeStr = "YZ "; position.z += node->fDistance; } else if( node->planeType == EModelBspNodePlaneType_Leaf ) { planeStr = "LEAF "; assert( node->fDistance == 0.0f ); } // draw node string and depth @ position if( node->children[0] < 0 && node->children[1] < 0 ) return; if( node->children[0] >= 0 ) { drawNode( nodes[ node->children[0] ], position ); } if( node->children[1] >= 0 ) { drawNode( nodes[ node->children[1] ], position ); }}
Steff sent me the thread this morning so i made a quick visualizer from scratch this evening. I guess it should be sorta like this, right:/Code follows a bit later, just found a little bug.
Video:Code:http://fbe.am/bZx
My current project: Nothing