/*
============
idAASBuild::ClipBrushSidesWithProcBSP
============
*/
void idAASBuild::ClipBrushSidesWithProcBSP( idBrushList &brushList ) {
	int i, clippedSides;
	idBrush *brush;
	idFixedWinding neww;
	idBounds bounds;
	float radius;
	idVec3 origin;
	// if the .proc file has no BSP tree
	if( idAASBuild::procNodes == NULL ) {
		return;
	}
	clippedSides = 0;
	for( brush = brushList.Head(); brush; brush = brush->Next() ) {
		for( i = 0; i < brush->GetNumSides(); i++ ) {
			if( !brush->GetSide( i )->GetWinding() ) {
				continue;
			}
			// make a local copy of the winding
			neww = *brush->GetSide( i )->GetWinding();
			neww.GetBounds( bounds );
			origin = ( bounds[1] - bounds[0] ) * 0.5f;
			radius = origin.Length() + ON_EPSILON;
			origin = bounds[0] + origin;
			if( ChoppedAwayByProcBSP( 0, &neww, brush->GetSide( i )->GetPlane().Normal(), origin, radius ) ) {
				brush->GetSide( i )->SetFlag( SFL_USED_SPLITTER );
				clippedSides++;
			}
		}
	}
	common->Printf( "%6d brush sides clipped\n", clippedSides );
}
Example #2
0
/*
============
idBrushMap::WriteBrushList
============
*/
void idBrushMap::WriteBrushList( const idBrushList& brushList )
{
	idBrush* b;
	
	if( !fp )
	{
		return;
	}
	
	for( b = brushList.Head(); b; b = b->Next() )
	{
		WriteBrush( b );
	}
}