# Legacy:TarquinBuilderBase

**This is not yet released**. An abstract class that holds functions used by the other builders in the Tarquin pack. This page is a reference for the foolhardy wishing to script builders which inherit the functions of this class.

## Contents

## Variables

- DynItemName
- this is used to set polygon names with expressions. (kudos to Mych for the idea. :) )

## Enumerations

- EAlignStyle
- An extension of Epic's AlignToSide parameter for cylinder-type objects:

- AL_Plain,
- AL_Side,
- AL_Caps.

- EEdgeTriangulation
- * ET_None,
- * ET_Clockwise,
- * ET_AntiClockwise,
- * ET_Alternating

- EItemNaming
- * IN_Levels,
- * IN_Slices,
- * IN_All

## Constants

- UUCircle = 65536.0f – a full circle in UU angle units
- ZeroVect = vect(0,0,0) – because "vect(0,0,0)" doesn't work inside function calls & so forth
- SheetPolyFlags = 0x00000108 – for testing purposes. If a brush isn't complete, UnrealEd is happier if it's marked as a sheet. This constant is here because I couldn't be bothered looking up the correct flag setting every time.

## General Functions

### divides operator

### Assume

Assume( float UserInput, float AssumeValue

This is a way of coding in a single place the interface shortcuts such as "set SidesUsed to zero to mean use the value of Sides". Embed a call to Assume in a function call.

Returns UserInput unless it's non-positive. In this case, return AssumeValue. Note that it's still the responsiblity of the brushbuilder class to check parameters make sense.

Example 1: A value of 0 for InnerHeight means "use value of OuterHeight"

Assume( InnerHeight, OuterHeight )

Example 2: A negative value in InnerRadius means use it as a thickness; remember the minus sign is included in InnerRadius.

Assume( InnerRadius, OuterRadius+InnerRadius )

## Building functions

### BuildCirclet

Creates a ring of vertices, partial or complete. The cylinder, sphere and pyramid all use this.

- float xRadius, yRadius
- Radii of the ring. If the values are different, the ring will be elliptical.
- float z
- Height of the ring: z coordinate of all created vertices.
- float Crowning
- rotates all the vertices around the centre. Expressed as a fraction of the Side angle.
- int Sides, SidesUsed
- work as expected. Note that the function handles the user-convenience value SidesUsed=0, and also deals with SidesUsed > Sides, so there's no need to check this input.
- EAlignStyle Alignment
- Pass the user-set alignment value.
- bool Pole
- Whether or not to build a pole depends on a number of factors, including 1) whether the user has selected a split cap 2) the ratio of SidesUsed to Sides

- Note to self
- why isn't this automatic? Why can't the function determine for itself whether a pole is needed or not? There should probably be an override for things like the Torus. So this would mean another enum: True, False, Auto
- (june 03) false = no pole; true = pole if function believes needed.

Use:

- Cylinder: builds pole itself since height different (innerHeight / OuterHeight)
- Pyramid: passes a Pole variable it has set itself: this could be nicely passed up to the Base class
- Pano: not yet switch to use Base (is pano useful in UEd3?)
- Torus: not yet switch to use Base.

## Dressing Functions

Dressing functions handle the definition of polys once the vertices have been created. There are currently 4 of these: two are general, and two are specialized for the cylinder.

### DressCap

This handles a ring of vertices that are to be made into a cap.

- int Dir
- direction of polys: sgn to pass on to the poly building functions.
- int StartVertex
- index of the first vertex
- int Sides
- number of sides (direct user input: special meanings handled)
- int SidesUsed
- number of sides used (direct user input: special meanings handled)
- bool SplitCaps
- Force cap to be split into triangles even is this is not required by the geometry
- bool Pole
- whether to build a pole. If SplitCaps == true, this is irrelevant
- int vPole
- the pole vertex. if -1, assumed to be at the end of the circlet vertices. Only used by the split cap section (whether split is forced by the input or necessary)
- EAlignStyle Alignment

### DressCylinderCap

This handles caps on cylinder shapes:

- supports partial cap
- feed it the alignment type and the user's set sides: no need to work out how many sides there
*actually*are.

- int Layers
- number of solid layers, like a cake. Note this is a different concept to DressTube's
*Levels*parameter. Yes, it's illogical, I know. DressTube is at a lower level conceptually & deals with raw data, ie vertex rings. DCC deals with user parameters and the user thinks in solid layers. See? There's some sense there if you look hard enough... - int Sides
- int SidesUsed
- bool Pole
- bool Hollow
- EAlignStyle Alignment
- bool SplitCaps
- Gives the option to force the cap to be made from triangles. Some configurations will force this anyway.

### DressCylinderSides

This handles all the side polys on cylinders.

- int Layers
- int Sides
- int SidesUsed
- bool Pole
- bool Hollow
- EAlignStyle Alignment
- EEdgeTriangulation SideTri

### DressTube

The multi-purpose all-singing, all dancing poly building function.

- int sgn
- orientation of polys. Same as sgn paramter in Poly3i etc.
- int Ofs
- the number of the first vertex.
- int LevelOfs
- number of vertices to skip between rings.
- int Panels
- number of desired poly panels per layer
- int Levels
- number of vertex rings ie number of layers + 1 for unlooped.
- bool Looped
- creates an extra row of polys that joins the last vertex ring to the first
- bool Closed
- joins the first poly panel to the last, like a cylinder. With both Looped and Closed set to false, this function makes a tesselated square of polys.
- EEdgeTriangulation PanelStyle
- options to split the panel polys into triangles
- EItemNaming ItemStyle
- item naming options
- optional name ItemName
- item name given to the polys. ItemStyle options append a number to this
- optional int PolyFlags
- same as the native poly building functions

## Related Topics

- BrushBuilder class
- Brushbuilders in general