Detailed Description

A mesh made up of a dynamic number of "blocks". Each block always consists of two triangles and 4 vertices. This is used for displaying the content in 3D with a single mesh.

Public Member Functions

 DynamicMesh (UIBatch batch)
 Creates a new dynamic mesh which uses the hybrid shader and a texture atlas. More...
 
void NextBuffer ()
 Gets the next vertex buffer. More...
 
void SetFontAtlas (TextureAtlas atlas)
 Changes the font atlas used by the default material. More...
 
void SetGraphicsAtlas (TextureAtlas atlas)
 Sets a default material to this mesh. More...
 
void SetGlobalMaterial (Shader shader)
 
void SetMaterial (Material material)
 Applies the given material to this mesh. More...
 
void RequireNormals ()
 Let the mesh know that normals are required. More...
 
void RequireUV3 ()
 Let the mesh know that UV3 is required. More...
 
void ChangeParent ()
 Called to update the parenting of this mesh. More...
 
void PrepareForLayout ()
 Let the mesh know it's about to undergo a layout routine. PowerUI.Renderman.Layout. More...
 
void CompletedLayout ()
 After the draw pass, builds flat buffers. More...
 
void Flatten (BlockBuffer current, int blockCount)
 Called with the first buffer in a set. Flattens the set of verts into the provided mesh. More...
 
MeshBlock Allocate (Renderman renderer)
 Allocates a block from this mesh. Note that the block object is actually shared. The block can then have its vertices/triangles edited. Changes will be outputted visually when MeshBlock.Done is called. More...
 
void Flush ()
 Outputs all the verts/triangles etc to the underlying unity mesh. More...
 
void Destroy ()
 Permanently destroys this mesh. More...
 

Public Attributes

UIBatch Batch
 The batch this mesh belongs to. More...
 
int BlockCount
 The number of blocks that have been allocated. More...
 
Mesh OutputMesh
 The unity mesh that this will be flushed into. More...
 
Material Material
 The material to use when rendering. More...
 
Transform OutputTransform
 The transform of this mesh. More...
 
GameObject OutputGameObject
 The gameobjec that holds this mesh. More...
 
FixedSizeBuffer< Vector2 > UV
 An array of uv coordinates. More...
 
FixedSizeBuffer< Vector2 > UV2
 An array of uv coordinates. More...
 
FixedSizeBuffer< Vector2 > UV3
 An array of uv coordinates. More...
 
FixedSizeBuffer< int > Triangles
 An array of triangles. More...
 
FixedSizeBuffer< Color > Colours
 An array of vertex colours. More...
 
FixedSizeBuffer< Vector3 > Normals
 An array of normals. More...
 
FixedSizeBuffer< Vector3 > Vertices
 An array of vertex coordinates. More...
 
BlockBuffer LastBuffer
 The raw vertex buffer linked list. Data is written into these. If we create too many verts, it simply creates another buffer. Flatten is used to convert this flexible structure into the actual vector3[] etc. More...
 
BlockBuffer FirstBuffer
 The raw vertex buffer linked list. Data is written into these. If we create too many verts, it simply creates another buffer. Flatten is used to convert this flexible structure into the actual vector3[] etc. More...
 
int CurrentBufferBlocks
 # of blocks in the current buffer. More...
 
int FullBufferCount
 Total number of full buffers. More...
 

Properties

int TotalBlockCount [get]
 Total number of allocated blocks. More...
 

Private Member Functions

void Setup ()
 Called only by constructors. This creates the actual mesh and the buffers for verts/tris etc. More...
 

Private Attributes

int LastBlockCount
 The number of blocks that were allocated last UI update. More...
 
MeshRenderer Renderer
 The renderer being used to layout the blocks. More...
 
Material GlobalMaterial
 The material used by this mesh when it is using an atlas. More...
 

Constructor & Destructor Documentation

PowerUI.DynamicMesh.DynamicMesh ( UIBatch  batch)
inline

Creates a new dynamic mesh which uses the hybrid shader and a texture atlas.

Member Function Documentation

MeshBlock PowerUI.DynamicMesh.Allocate ( Renderman  renderer)
inline

Allocates a block from this mesh. Note that the block object is actually shared. The block can then have its vertices/triangles edited. Changes will be outputted visually when MeshBlock.Done is called.

void PowerUI.DynamicMesh.ChangeParent ( )
inline

Called to update the parenting of this mesh.

void PowerUI.DynamicMesh.CompletedLayout ( )
inline

After the draw pass, builds flat buffers.

void PowerUI.DynamicMesh.Destroy ( )
inline

Permanently destroys this mesh.

void PowerUI.DynamicMesh.Flatten ( BlockBuffer  current,
int  blockCount 
)
inline

Called with the first buffer in a set. Flattens the set of verts into the provided mesh.

void PowerUI.DynamicMesh.Flush ( )
inline

Outputs all the verts/triangles etc to the underlying unity mesh.

void PowerUI.DynamicMesh.NextBuffer ( )
inline

Gets the next vertex buffer.

void PowerUI.DynamicMesh.PrepareForLayout ( )
inline

Let the mesh know it's about to undergo a layout routine. PowerUI.Renderman.Layout.

void PowerUI.DynamicMesh.RequireNormals ( )
inline

Let the mesh know that normals are required.

void PowerUI.DynamicMesh.RequireUV3 ( )
inline

Let the mesh know that UV3 is required.

void PowerUI.DynamicMesh.SetFontAtlas ( TextureAtlas  atlas)
inline

Changes the font atlas used by the default material.

void PowerUI.DynamicMesh.SetGlobalMaterial ( Shader  shader)
inline
void PowerUI.DynamicMesh.SetGraphicsAtlas ( TextureAtlas  atlas)
inline

Sets a default material to this mesh.

void PowerUI.DynamicMesh.SetMaterial ( Material  material)
inline

Applies the given material to this mesh.

Parameters
materialThe material to apply.
void PowerUI.DynamicMesh.Setup ( )
inlineprivate

Called only by constructors. This creates the actual mesh and the buffers for verts/tris etc.

Member Data Documentation

UIBatch PowerUI.DynamicMesh.Batch

The batch this mesh belongs to.

int PowerUI.DynamicMesh.BlockCount

The number of blocks that have been allocated.

FixedSizeBuffer<Color> PowerUI.DynamicMesh.Colours

An array of vertex colours.

int PowerUI.DynamicMesh.CurrentBufferBlocks

# of blocks in the current buffer.

BlockBuffer PowerUI.DynamicMesh.FirstBuffer

The raw vertex buffer linked list. Data is written into these. If we create too many verts, it simply creates another buffer. Flatten is used to convert this flexible structure into the actual vector3[] etc.

int PowerUI.DynamicMesh.FullBufferCount

Total number of full buffers.

Material PowerUI.DynamicMesh.GlobalMaterial
private

The material used by this mesh when it is using an atlas.

int PowerUI.DynamicMesh.LastBlockCount
private

The number of blocks that were allocated last UI update.

BlockBuffer PowerUI.DynamicMesh.LastBuffer

The raw vertex buffer linked list. Data is written into these. If we create too many verts, it simply creates another buffer. Flatten is used to convert this flexible structure into the actual vector3[] etc.

Material PowerUI.DynamicMesh.Material

The material to use when rendering.

FixedSizeBuffer<Vector3> PowerUI.DynamicMesh.Normals

An array of normals.

GameObject PowerUI.DynamicMesh.OutputGameObject

The gameobjec that holds this mesh.

Mesh PowerUI.DynamicMesh.OutputMesh

The unity mesh that this will be flushed into.

Transform PowerUI.DynamicMesh.OutputTransform

The transform of this mesh.

MeshRenderer PowerUI.DynamicMesh.Renderer
private

The renderer being used to layout the blocks.

FixedSizeBuffer<int> PowerUI.DynamicMesh.Triangles

An array of triangles.

FixedSizeBuffer<Vector2> PowerUI.DynamicMesh.UV

An array of uv coordinates.

FixedSizeBuffer<Vector2> PowerUI.DynamicMesh.UV2

An array of uv coordinates.

FixedSizeBuffer<Vector2> PowerUI.DynamicMesh.UV3

An array of uv coordinates.

FixedSizeBuffer<Vector3> PowerUI.DynamicMesh.Vertices

An array of vertex coordinates.

Property Documentation

int PowerUI.DynamicMesh.TotalBlockCount
get

Total number of allocated blocks.