6.3 Portals 373
void Portal::UpdateWorldData (const Transformation& rkWorld)
{
rkWorld.ApplyForward(m_iVQuantity,m_akModelVertex,
m_akWorldVertex);
}
The culling function in both classes is an implementation of the traversal of a
directed graph. Because the graph most likely has cycles, the code needs to maintain
Boolean flags indicating whether or not a region has already been visited to prevent
an infinite loop. The
ConvexRegion class has a data member, m_bVisited, for this
purpose. The drawing routine for a convex region is
void ConvexRegion::GetVisibleSet (Culler& rkCuller,
bool bNoCull)
{
if (!m_bVisited)
{
m_bVisited = true;
// Add anything visible through open portals.
for(inti=0;i<m_iPQuantity; i++)
{
m_apkPortal[i]->GetVisibleSet(rkCuller,bNoCull);
}
//