3rd Eye Scene C#
3rd Eye Scene C# documentation
Tes::Shapes::SimpleMesh Class Reference

A simple MeshResource implementation. More...

Inheritance diagram for Tes::Shapes::SimpleMesh:
Tes::Shapes::MeshBase Tes::Shapes::MeshResource Tes::Resource

List of all members.

Public Member Functions

 SimpleMesh (uint id, MeshDrawType drawType=MeshDrawType.Triangles, MeshComponentFlag components=MeshComponentFlag.Vertex|MeshComponentFlag.Index)
 Create a new mesh resource.
override uint VertexCount (int stream=0)
 Exposes the number of vertices in the mesh.
override uint IndexCount (int stream=0)
 Exposes the number of indices in the mesh.
override Vector3[] Vertices (int stream=0)
 Supports iteration of the vertices of the mesh.
override int[] Indices4 (int stream=0)
 Supports iteration of the indices of the mesh when using four byte indices.
override Vector3[] Normals (int stream=0)
 Supports iteration of the normal of the mesh.
override Vector2[] UVs (int stream=0)
 Supports iteration of the UV coordinates of the mesh.
override uint[] Colours (int stream=0)
 Supports iteration of per vertex colours of the mesh.
void SetVertex (int at, Vector3 v)
 Sets the vertex at the given index.
void AddVertex (Vector3 v)
 Adds a vertex.
void AddVertices (IEnumerable< Vector3 > vertices)
 Adds a number of vertices.
void SetIndex (int at, int index)
 Sets an index value.
void AddIndex (int index)
 Adds an index value.
void AddIndices (IEnumerable< int > indices)
 Add a set of indices.
void SetNormal (int at, Vector3 normal)
 Set a vertex normal.
void AddNormal (Vector3 normal)
 Add a vertex normal.
void AddNormals (IEnumerable< Vector3 > normals)
 Add a list of normals.
void SetUV (int at, Vector2 uv)
 Set a vertex UV coordinate.
void AddUV (Vector2 uv)
 Add a vertex UV coordinate.
void AddUV (IEnumerable< Vector2 > uvs)
 Add a list of UV coordinates.
void SetColour (int at, uint colour)
 Set a vertex colour.
void AddColour (uint colour)
 Add a vertex colour.
void AddColours (IEnumerable< uint > colours)
 Add a list of colours.

Protected Member Functions

void EnsureIndices ()
 Ensures indices are marked as required and allocated.
void EnsureNormals ()
 Ensures normals are marked as required and allocated.
void EnsureUVs ()
 Ensures UVs are marked as required and allocated.
void EnsureColours ()
 Ensures colours are marked as required and allocated.

Properties

override int IndexSize [get]
 Defines the byte size used by indices in this mesh.

Detailed Description

A simple MeshResource implementation.


Constructor & Destructor Documentation

Tes::Shapes::SimpleMesh::SimpleMesh ( uint  id,
MeshDrawType  drawType = MeshDrawType.Triangles,
MeshComponentFlag  components = MeshComponentFlag.Vertex | MeshComponentFlag.Index 
) [inline]

Create a new mesh resource.

Parameters:
idThe unique mesh resource ID for this mesh.
drawTypeDefines the topology.
componentsIdentifies the required MeshComponentFlag.

Member Function Documentation

void Tes::Shapes::SimpleMesh::AddColour ( uint  colour) [inline]

Add a vertex colour.

Parameters:
colourThe colour value.
void Tes::Shapes::SimpleMesh::AddColours ( IEnumerable< uint >  colours) [inline]

Add a list of colours.

Parameters:
coloursThe colours to add
void Tes::Shapes::SimpleMesh::AddIndex ( int  index) [inline]

Adds an index value.

Parameters:
indexThe index value (referencing a valid vertex).
void Tes::Shapes::SimpleMesh::AddIndices ( IEnumerable< int >  indices) [inline]

Add a set of indices.

Parameters:
indicesIndices to add.
void Tes::Shapes::SimpleMesh::AddNormal ( Vector3  normal) [inline]

Add a vertex normal.

Parameters:
normalThe normal value.
void Tes::Shapes::SimpleMesh::AddNormals ( IEnumerable< Vector3 normals) [inline]

Add a list of normals.

Parameters:
normalsThe normals to add
void Tes::Shapes::SimpleMesh::AddUV ( Vector2  uv) [inline]

Add a vertex UV coordinate.

Parameters:
uvThe UV coordinate.
void Tes::Shapes::SimpleMesh::AddUV ( IEnumerable< Vector2 uvs) [inline]

Add a list of UV coordinates.

Parameters:
uvsThe UV coordinates.
void Tes::Shapes::SimpleMesh::AddVertex ( Vector3  v) [inline]

Adds a vertex.

Parameters:
vThe vertex to add.
void Tes::Shapes::SimpleMesh::AddVertices ( IEnumerable< Vector3 vertices) [inline]

Adds a number of vertices.

Parameters:
verticesVertices to add.
override uint [] Tes::Shapes::SimpleMesh::Colours ( int  stream = 0) [inline, virtual]

Supports iteration of per vertex colours of the mesh.

Parameters:
streamFor future use. Must be zero.

Implements Tes::Shapes::MeshBase.

override uint Tes::Shapes::SimpleMesh::IndexCount ( int  stream = 0) [inline, virtual]

Exposes the number of indices in the mesh.

Returns:
The number of indices in this mesh.
Parameters:
streamFor future use. Must be zero.

Implements Tes::Shapes::MeshBase.

override int [] Tes::Shapes::SimpleMesh::Indices4 ( int  stream = 0) [inline, virtual]

Supports iteration of the indices of the mesh when using four byte indices.

Parameters:
streamFor future use. Must be zero.

Reimplemented from Tes::Shapes::MeshBase.

override Vector3 [] Tes::Shapes::SimpleMesh::Normals ( int  stream = 0) [inline, virtual]

Supports iteration of the normal of the mesh.

Parameters:
streamFor future use. Must be zero.

Implements Tes::Shapes::MeshBase.

void Tes::Shapes::SimpleMesh::SetColour ( int  at,
uint  colour 
) [inline]

Set a vertex colour.

Parameters:
atThe vertex index.
colourThe colour value.
void Tes::Shapes::SimpleMesh::SetIndex ( int  at,
int  index 
) [inline]

Sets an index value.

Parameters:
atThe index's position in the index array.
indexThe index value (referencing a valid vertex).
void Tes::Shapes::SimpleMesh::SetNormal ( int  at,
Vector3  normal 
) [inline]

Set a vertex normal.

Parameters:
atThe vertex index.
normalThe normal value.
void Tes::Shapes::SimpleMesh::SetUV ( int  at,
Vector2  uv 
) [inline]

Set a vertex UV coordinate.

Parameters:
atThe vertex index.
uvThe UV coordinate.
void Tes::Shapes::SimpleMesh::SetVertex ( int  at,
Vector3  v 
) [inline]

Sets the vertex at the given index.

Parameters:
atVertex index.
vThe vertex value.
override Vector2 [] Tes::Shapes::SimpleMesh::UVs ( int  stream = 0) [inline, virtual]

Supports iteration of the UV coordinates of the mesh.

Parameters:
streamFor future use. Must be zero.

Implements Tes::Shapes::MeshBase.

override uint Tes::Shapes::SimpleMesh::VertexCount ( int  stream = 0) [inline, virtual]

Exposes the number of vertices in the mesh.

Returns:
The number of vertices in this mesh.
Parameters:
streamFor future use. Must be zero.

Implements Tes::Shapes::MeshBase.

override Vector3 [] Tes::Shapes::SimpleMesh::Vertices ( int  stream = 0) [inline, virtual]

Supports iteration of the vertices of the mesh.

Parameters:
streamFor future use. Must be zero.

Implements Tes::Shapes::MeshBase.


Property Documentation

override int Tes::Shapes::SimpleMesh::IndexSize [get]

Defines the byte size used by indices in this mesh.

4

Reimplemented from Tes::Shapes::MeshBase.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Enumerations Properties Events