Editor
Class BrushBuilder

source: c:\runehov\Editor\Classes\BrushBuilder.uc
Core.Object
   |
   +--Editor.BrushBuilder
Direct Known Subclasses:ConeBuilder, CubeBuilder, CylinderBuilder, SheetBuilder, TetrahedronBuilder

class BrushBuilder
extends Core.Object

//============================================================================= // BrushBuilder: Base class of UnrealEd brush builders. // // Tips for writing brush builders: // // * Always validate the user-specified and call BadParameters function // if anything is wrong, instead of actually building geometry. // If you build an invalid brush due to bad user parameters, you'll // cause an extraordinary amount of pain for the poor user. // // * When generating polygons with more than 3 vertices, BE SURE all the // polygon's vertices are coplanar! Out-of-plane polygons will cause // geometry to be corrupted. //=============================================================================
Variables
 name Group
 bool MergeCoplanars
 array Polys
 array Vertices


Function Summary
 bool BadParameters(optional string)
 void BeginBrush(bool MergeCoplanars, name Group)
     
// Native support.
 bool EndBrush()
 int GetPolyCount()
 vector GetVertex(int i)
 int GetVertexCount()
 void Poly3i(int Direction, int i, int j, int k, optional name, optional int)
 void Poly4i(int Direction, int i, int j, int k, int l, optional name, optional int)
 void PolyBegin(int Direction, optional name, optional int)
 void PolyEnd()
 void Polyi(int i)
 int Vertex3f(float x, float y, float z)
 int Vertexv(vector v)



Source Code


00001	//=============================================================================
00002	// BrushBuilder: Base class of UnrealEd brush builders.
00003	//
00004	// Tips for writing brush builders:
00005	//
00006	// * Always validate the user-specified and call BadParameters function
00007	//   if anything is wrong, instead of actually building geometry.
00008	//   If you build an invalid brush due to bad user parameters, you'll
00009	//   cause an extraordinary amount of pain for the poor user.
00010	//
00011	// * When generating polygons with more than 3 vertices, BE SURE all the
00012	//   polygon's vertices are coplanar!  Out-of-plane polygons will cause
00013	//   geometry to be corrupted.
00014	//=============================================================================
00015	class BrushBuilder
00016		expands Object
00017		abstract
00018		native;
00019	
00020	// Internal state, not accessible to script.
00021	struct BuilderPoly
00022	{
00023		var array<int> VertexIndices;
00024		var int Direction;
00025		var name Item;
00026		var int PolyFlags;
00027	};
00028	var private array<vector> Vertices;
00029	var private array<BuilderPoly> Polys;
00030	var private name Group;
00031	var private bool MergeCoplanars;
00032	
00033	// Native support.
00034	native function BeginBrush( bool MergeCoplanars, name Group );
00035	native function bool EndBrush();
00036	native function int GetVertexCount();
00037	native function vector GetVertex( int i );
00038	native function int GetPolyCount();
00039	native function bool BadParameters( optional string msg );
00040	native function int Vertexv( vector v );
00041	native function int Vertex3f( float x, float y, float z );
00042	native function Poly3i( int Direction, int i, int j, int k, optional name ItemName, optional int PolyFlags );
00043	native function Poly4i( int Direction, int i, int j, int k, int l, optional name ItemName, optional int PolyFlags );
00044	native function PolyBegin( int Direction, optional name ItemName, optional int PolyFlags );
00045	native function Polyi( int i );
00046	native function PolyEnd();
00047	
00048	// Build interface.
00049	event bool Build();
00050	
00051	defaultproperties
00052	{
00053	}

End Source Code