Detailed Description

A pool of mesh buffers are used during GPU shape draws. They store generated meshes and display them to a TextureCamera.

Inheritance diagram for Blaze.MeshBuffer:
Blaze.PointReceiver

Public Member Functions

 MeshBuffer ()
 
void CreateGameObject ()
 
void AddMesh (VectorPath path, float xOffset, float yOffset, Triangulator triangulator)
 
void AddPoint (float x, float y)
 
void MoveTo (float x, float y)
 
void SetActive (bool active)
 
void RequireSize (int verts, int tris)
 
void Flush ()
 

Public Attributes

float XScaleFactor =-10f
 A number to scale the mesh by. More...
 
float YScaleFactor =10f
 A number to scale the mesh by. More...
 
float XOffset
 A number to offset the mesh by on x. More...
 
float YOffset
 A number to offset the mesh by on y. More...
 
Mesh Mesh
 The underlying unity mesh. More...
 
int TotalVertices
 The total number of verts being used. Note that it's not necessarily the same as Vertices.Length. More...
 
Vector3[] Vertices
 The computed vertices. More...
 
Color32[] Colours
 The vertex colour set. More...
 
int[] Triangles
 Triangle set. More...
 
int CurrentVertex
 Current vertex progress. More...
 
int CurrentTriangle
 Current triangle progress. More...
 
MeshBuffer NextInPool
 Pooled meshes are stored as a linked list. More...
 

Static Public Attributes

static Material SharedMaterial
 The material shared by all mesh buffers. More...
 

Package Attributes

GameObject Gameobject
 The gameobject the mesh is attached to. More...
 

Properties

float SampleDistance [get, set]
 
- Properties inherited from Blaze.PointReceiver
float SampleDistance [get, set]
 

Private Attributes

bool CloseBeforeThis =true
 True if there is a close before the current node. More...
 
bool IsClosing
 Is the current rendering node a close? More...
 
float CloseX
 The close x coordinate. More...
 
float CloseY
 The close y coordinate. More...
 
float PreviousX
 The previous x coordinate. More...
 
float PreviousY
 The previous y coordinate. More...
 
float PreviousInnerSpread
 The inner spread used by the previous segment. More...
 
float PreviousOuterSpread
 The outer spread used by the previous segment. More...
 
int StartIndex
 Vertex index of the "first" tent on a path. More...
 
bool Moved =true
 True if a MoveTo just occured. More...
 
MoveFromPoint LatestMoveFrom
 The stack of non-closed MoveTo nodes. More...
 
float CurrentAccuracy
 The current curve sampling accuracy. More...
 
bool Winding =true
 
Triangulator Triangulator =null
 
TriangulationVertex FirstInContour
 
TriangulationVertex LastInContour
 

Static Private Attributes

static readonly Color32 MidGrey =new Color32(255,255,255,127)
 
static readonly Color32 White =new Color32(255,255,255,255)
 
static readonly Color32 Black =new Color32(255,255,255,0)
 

Constructor & Destructor Documentation

Blaze.MeshBuffer.MeshBuffer ( )
inline

Member Function Documentation

void Blaze.MeshBuffer.AddMesh ( VectorPath  path,
float  xOffset,
float  yOffset,
Triangulator  triangulator 
)
inline
void Blaze.MeshBuffer.AddPoint ( float  x,
float  y 
)
inline

Implements Blaze.PointReceiver.

void Blaze.MeshBuffer.CreateGameObject ( )
inline
void Blaze.MeshBuffer.Flush ( )
inline
void Blaze.MeshBuffer.MoveTo ( float  x,
float  y 
)
inline

Implements Blaze.PointReceiver.

void Blaze.MeshBuffer.RequireSize ( int  verts,
int  tris 
)
inline
void Blaze.MeshBuffer.SetActive ( bool  active)
inline

Member Data Documentation

readonly Color32 Blaze.MeshBuffer.Black =new Color32(255,255,255,0)
staticprivate
bool Blaze.MeshBuffer.CloseBeforeThis =true
private

True if there is a close before the current node.

float Blaze.MeshBuffer.CloseX
private

The close x coordinate.

float Blaze.MeshBuffer.CloseY
private

The close y coordinate.

Color32 [] Blaze.MeshBuffer.Colours

The vertex colour set.

float Blaze.MeshBuffer.CurrentAccuracy
private

The current curve sampling accuracy.

int Blaze.MeshBuffer.CurrentTriangle

Current triangle progress.

int Blaze.MeshBuffer.CurrentVertex

Current vertex progress.

TriangulationVertex Blaze.MeshBuffer.FirstInContour
private
GameObject Blaze.MeshBuffer.Gameobject
package

The gameobject the mesh is attached to.

bool Blaze.MeshBuffer.IsClosing
private

Is the current rendering node a close?

TriangulationVertex Blaze.MeshBuffer.LastInContour
private
MoveFromPoint Blaze.MeshBuffer.LatestMoveFrom
private

The stack of non-closed MoveTo nodes.

Mesh Blaze.MeshBuffer.Mesh

The underlying unity mesh.

readonly Color32 Blaze.MeshBuffer.MidGrey =new Color32(255,255,255,127)
staticprivate
bool Blaze.MeshBuffer.Moved =true
private

True if a MoveTo just occured.

MeshBuffer Blaze.MeshBuffer.NextInPool

Pooled meshes are stored as a linked list.

float Blaze.MeshBuffer.PreviousInnerSpread
private

The inner spread used by the previous segment.

float Blaze.MeshBuffer.PreviousOuterSpread
private

The outer spread used by the previous segment.

float Blaze.MeshBuffer.PreviousX
private

The previous x coordinate.

float Blaze.MeshBuffer.PreviousY
private

The previous y coordinate.

Material Blaze.MeshBuffer.SharedMaterial
static

The material shared by all mesh buffers.

int Blaze.MeshBuffer.StartIndex
private

Vertex index of the "first" tent on a path.

int Blaze.MeshBuffer.TotalVertices

The total number of verts being used. Note that it's not necessarily the same as Vertices.Length.

int [] Blaze.MeshBuffer.Triangles

Triangle set.

Triangulator Blaze.MeshBuffer.Triangulator =null
private
Vector3 [] Blaze.MeshBuffer.Vertices

The computed vertices.

readonly Color32 Blaze.MeshBuffer.White =new Color32(255,255,255,255)
staticprivate
bool Blaze.MeshBuffer.Winding =true
private
float Blaze.MeshBuffer.XOffset

A number to offset the mesh by on x.

float Blaze.MeshBuffer.XScaleFactor =-10f

A number to scale the mesh by.

float Blaze.MeshBuffer.YOffset

A number to offset the mesh by on y.

float Blaze.MeshBuffer.YScaleFactor =10f

A number to scale the mesh by.

Property Documentation

float Blaze.MeshBuffer.SampleDistance
getset