本文整理汇总了C++中idBrushList::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ idBrushList::Clear方法的具体用法?C++ idBrushList::Clear怎么用?C++ idBrushList::Clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类idBrushList
的用法示例。
在下文中一共展示了idBrushList::Clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Split
/*
============
idBrushList::Split
============
*/
void idBrushList::Split( const idPlane& plane, int planeNum, idBrushList& frontList, idBrushList& backList, bool useBrushSavedPlaneSide )
{
idBrush* b, *front, *back;
frontList.Clear();
backList.Clear();
if( !useBrushSavedPlaneSide )
{
for( b = head; b; b = b->next )
{
b->Split( plane, planeNum, &front, &back );
if( front )
{
frontList.AddToTail( front );
}
if( back )
{
backList.AddToTail( back );
}
}
return;
}
for( b = head; b; b = b->next )
{
if( b->savedPlaneSide & BRUSH_PLANESIDE_BOTH )
{
b->Split( plane, planeNum, &front, &back );
if( front )
{
frontList.AddToTail( front );
}
if( back )
{
backList.AddToTail( back );
}
}
else if( b->savedPlaneSide & BRUSH_PLANESIDE_FRONT )
{
frontList.AddToTail( b->Copy() );
}
else
{
backList.AddToTail( b->Copy() );
}
}
}
示例2: Subtract
/*
============
idBrush::Subtract
============
*/
bool idBrush::Subtract( const idBrush* b, idBrushList& list ) const
{
int i;
idBrush* front, *back;
const idBrush* in;
list.Clear();
in = this;
for( i = 0; i < b->sides.Num() && in; i++ )
{
in->Split( b->sides[i]->plane, b->sides[i]->planeNum, &front, &back );
if( in != this )
{
delete in;
}
if( front )
{
list.AddToTail( front );
}
in = back;
}
// if didn't really intersect
if( !in )
{
list.Free();
return false;
}
delete in;
return true;
}