## Editor
Class VolumetricBuilder

source: C:\XIII\Editor\Classes\VolumetricBuilder.uc

    Core.Object
       |
       +--Editor.BrushBuilder
          |
          +--Editor.VolumetricBuilder

Direct Known Subclasses:None

class VolumetricBuilder
extends Editor.BrushBuilder

    //=============================================================================
    // VolumetricBuilder: Builds a volumetric brush (criss-crossed sheets).
    //=============================================================================

Variables
`name` | `GroupName`
`int` | `NumSheets`
`Height,` | `Radius`

Function Summary
`bool` | `Build()`
`void` | `BuildVolumetric(int Direction, int NumSheets, float Height, float Radius)`

Source Code

    00001	//=============================================================================
    00002	// VolumetricBuilder: Builds a volumetric brush (criss-crossed sheets).
    00003	//=============================================================================
    00004	class VolumetricBuilder
    00005		extends BrushBuilder;
    00006
    00007	var() float Height, Radius;
    00008	var() int NumSheets;
    00009	var() name GroupName;
    00010
    00011	function BuildVolumetric( int Direction, int NumSheets, float Height, float Radius )
    00012	{
    00013		local int n,x,y;
    00014		local rotator RotStep;
    00015		local vector vtx, NewVtx;
    00016
    00017		n = GetVertexCount();
    00018		RotStep.Yaw = 65536.0f / (NumSheets * 2);
    00019
    00020		// Vertices.
    00021		vtx.x = Radius;
    00022		vtx.z = Height / 2;
    00023		for( x = 0 ; x < (NumSheets * 2) ; x++ )
    00024		{
    00025			NewVtx = vtx >> (RotStep * x);
    00026			Vertex3f( NewVtx.x, NewVtx.y, NewVtx.z );
    00027			Vertex3f( NewVtx.x, NewVtx.y, NewVtx.z - Height );
    00028		}
    00029
    00030		// Polys.
    00031		for( x = 0 ; x < NumSheets ; x++ )
    00032		{
    00033			y = (x*2) + 1;
    00034			if( y >= (NumSheets * 2) ) y -= (NumSheets * 2);
    00035			Poly4i( Direction, n+(x*2), n+y, n+y+(NumSheets*2), n+(x*2)+(NumSheets*2), 'Sheets', 0x00000108); // PF_TwoSided|PF_NotSolid.
    00036		}
    00037	}
    00038
    00039	function bool Build()
    00040	{
    00041		if( NumSheets<2 )
    00042			return BadParameters();
    00043		if( Height<=0 || Radius<=0 )
    00044			return BadParameters();
    00045
    00046		BeginBrush( true, GroupName );
    00047		BuildVolumetric( +1, NumSheets, Height, Radius );
    00048		return EndBrush();
    00049	}
    00050
    00051	defaultproperties
    00052	{
    00053	     Height=128.000000
    00054	     Radius=64.000000
    00055	     NumSheets=2
    00056	     GroupName="Volumetric"
    00057	     BitmapFilename="BBVolumetric"
    00058	     ToolTip="Volumetric (Torches, Chains, etc)"
    00059	}

End Source Code