6.1 Binary Space Partitioning Trees 363
else
{
if (spkNChild)
{
spkNChild->OnGetVisibleSet(rkCuller,bNoCull);
}
if (spkCChild)
{
spkCChild->OnGetVisibleSet(rkCuller,bNoCull);
}
if (spkPChild)
{
spkPChild->OnGetVisibleSet(rkCuller,bNoCull);
}
}
}
if (m_kEffects.size() > 0)
{
// Place an ’end’ marker in the visible set to
// indicate that the global effect is inactive.
rkCuller.GetVisibleSet().Insert(0,0);
}
}
The three children must be drawn in back-to-front order. It is possible that any of
the three children have empty subtrees, so the smart pointers for those children must
be tested to see if they are not null before using them.
The first step, of course, is to determine on which side of the separating plane the
eye point is located. This is the role of the code
const ...