home *** CD-ROM | disk | FTP | other *** search
/ Game Level Design / GLDesign.bin / Software / UnrealEngine2Runtime / UE2Runtime-22262001_Demo.exe / Editor / Classes / BrushBuilder.uc < prev    next >
Text File  |  2003-10-22  |  2KB  |  59 lines

  1. //=============================================================================
  2. // BrushBuilder: Base class of UnrealEd brush builders.
  3. //
  4. // Tips for writing brush builders:
  5. //
  6. // * Always validate the user-specified and call BadParameters function
  7. //   if anything is wrong, instead of actually building geometry.
  8. //   If you build an invalid brush due to bad user parameters, you'll
  9. //   cause an extraordinary amount of pain for the poor user.
  10. //
  11. // * When generating polygons with more than 3 vertices, BE SURE all the
  12. //   polygon's vertices are coplanar!  Out-of-plane polygons will cause
  13. //   geometry to be corrupted.
  14. //=============================================================================
  15. class BrushBuilder
  16.     extends Object
  17.     abstract
  18.     native;
  19.  
  20. var(BrushBuilder) string BitmapFilename;
  21. var(BrushBuilder) string ToolTip;
  22.  
  23. // Internal state, not accessible to script.
  24. struct BuilderPoly
  25. {
  26.     var array<int> VertexIndices;
  27.     var int Direction;
  28.     var name Item;
  29.     var int PolyFlags;
  30. };
  31. var private array<vector> Vertices;
  32. var private array<BuilderPoly> Polys;
  33. var private name Group;
  34. var private bool MergeCoplanars;
  35.  
  36. // Native support.
  37. native function BeginBrush( bool MergeCoplanars, name Group );
  38. native function bool EndBrush();
  39. native function int GetVertexCount();
  40. native function vector GetVertex( int i );
  41. native function int GetPolyCount();
  42. native function bool BadParameters( optional string msg );
  43. native function int Vertexv( vector v );
  44. native function int Vertex3f( float x, float y, float z );
  45. native function Poly3i( int Direction, int i, int j, int k, optional name ItemName, optional int PolyFlags );
  46. native function Poly4i( int Direction, int i, int j, int k, int l, optional name ItemName, optional int PolyFlags );
  47. native function PolyBegin( int Direction, optional name ItemName, optional int PolyFlags );
  48. native function Polyi( int i );
  49. native function PolyEnd();
  50.  
  51. // Build interface.
  52. event bool Build();
  53.  
  54. defaultproperties
  55. {
  56.     BitmapFilename="BBGeneric"
  57.     ToolTip="Generic Builder"
  58. }
  59.