3rd Eye Scene C#
3rd Eye Scene C# documentation
Tes::Runtime::MeshBuilder::PartDetails Class Reference

Represents details of part of the mesh. More...

List of all members.

Public Member Functions

void Clear ()
 Clear the data mappings.
void AddFromIndex (int sourceIndex, MeshBuilder builder, List< int > partIndices, List< Vector3 > partVerts, List< Vector3 > partNormals, List< Color32 > partColours, List< Vector2 > partUVs)
 Add a vertex and associated data from the builder .
void UpdateVertices (MeshBuilder builder)
 Updates used vertices by copying mapped vertices from builder .
void UpdateNormals (MeshBuilder builder)
 Updates used normals by copying mapped normals from builder .
void UpdateColours (MeshBuilder builder)
 Updates used colours by copying mapped colours from builder .
void UpdateUVs (MeshBuilder builder)
 Updates used uvs by copying mapped uvs from builder .
bool UsesVertex (int vertexIndex)
 Check if this part references the vertex at vertexIndex in the source data.
bool UsesVertices (int firstVertexIndex, int count)
 Check if this part uses any vertex in the range given by [firstVertexIndex, firstVertexIndex + count].
bool UsesIndex (int indexIndex)
 Check if this part references the index at indexIndex in the source data.
bool UsesIndices (int firstIndexIndex, int count)
 Check if this part uses any index in the range given by [firstIndexIndex, firstIndexIndex + count].

Public Attributes

DirtyFlag Dirty = DirtyFlag.All
 Does the Mesh required update?
Mesh Mesh
 The Unity mesh representation.
Bounds Bounds = new Bounds()
 Mesh bounds.
List< int > ToSourceVertexMappings = new List<int>()
 Maps the part vertex indices back to the original vertex indices.
Dictionary< int, int > ToPartVertexMappings = new Dictionary<int, int>()
 Maps the original vertex indices to the part indices.
int FirstSourceIndex = 0
 Identifies the first index in the original mesh data this part represents.
int IndexCount = 0
 Identifies the number of index elements in this part.

Detailed Description

Represents details of part of the mesh.

A mesh part may be used to represent all of or part of the data in the owning MeshBuilder. In the case only a subset is represented (to respect Unity's limited indexing range), the part represents a contiguous set of indices from the original mesh data. The index range can be identifies by the FirstSourceIndex and IndexCount.


Member Function Documentation

void Tes::Runtime::MeshBuilder::PartDetails::AddFromIndex ( int  sourceIndex,
MeshBuilder  builder,
List< int >  partIndices,
List< Vector3 >  partVerts,
List< Vector3 >  partNormals,
List< Color32 >  partColours,
List< Vector2 >  partUVs 
) [inline]

Add a vertex and associated data from the builder .

Parameters:
sourceIndexThe index of the vertex to add in builder .
builderThe MeshBuilder to add from.
partIndicesIndex data for this part.
partVertsVertex data for this part.
partNormalsNormals data for this part.
partColoursColours data for this part.
partUVsUV data for this part.

The part maintains a map of previously added vertices and re-uses those if re-referenced.

void Tes::Runtime::MeshBuilder::PartDetails::UpdateColours ( MeshBuilder  builder) [inline]

Updates used colours by copying mapped colours from builder .

Parameters:
builderThe owning builder object.
void Tes::Runtime::MeshBuilder::PartDetails::UpdateNormals ( MeshBuilder  builder) [inline]

Updates used normals by copying mapped normals from builder .

Parameters:
builderThe owning builder object.
void Tes::Runtime::MeshBuilder::PartDetails::UpdateUVs ( MeshBuilder  builder) [inline]

Updates used uvs by copying mapped uvs from builder .

Parameters:
builderThe owning builder object.
void Tes::Runtime::MeshBuilder::PartDetails::UpdateVertices ( MeshBuilder  builder) [inline]

Updates used vertices by copying mapped vertices from builder .

Parameters:
builderThe owning builder object.
bool Tes::Runtime::MeshBuilder::PartDetails::UsesIndex ( int  indexIndex) [inline]

Check if this part references the index at indexIndex in the source data.

Parameters:
indexIndexThe source data index to test.
Returns:
True if referenced.
bool Tes::Runtime::MeshBuilder::PartDetails::UsesIndices ( int  firstIndexIndex,
int  count 
) [inline]

Check if this part uses any index in the range given by [firstIndexIndex, firstIndexIndex + count].

Parameters:
firstIndexIndexThe first source data index to test.
countThe number of indices to test.
Returns:
True if any index in the given range is referenced by this part.
bool Tes::Runtime::MeshBuilder::PartDetails::UsesVertex ( int  vertexIndex) [inline]

Check if this part references the vertex at vertexIndex in the source data.

Parameters:
vertexIndexThe source data index to test.
Returns:
True if referenced.
bool Tes::Runtime::MeshBuilder::PartDetails::UsesVertices ( int  firstVertexIndex,
int  count 
) [inline]

Check if this part uses any vertex in the range given by [firstVertexIndex, firstVertexIndex + count].

Parameters:
firstVertexIndexThe first source data index to test.
countThe number of indices to test.
Returns:
True if any vertex in the given range is referenced by this part.

Member Data Documentation

Mesh bounds.

May be rough.

Does the Mesh required update?

Dictionary<int, int> Tes::Runtime::MeshBuilder::PartDetails::ToPartVertexMappings = new Dictionary<int, int>()

Maps the original vertex indices to the part indices.

This creates the reverse mappings of ToSourceVertexMappings. If an entry is not found, then it is not used by this part.

Maps the part vertex indices back to the original vertex indices.

For example, if ToSourceVertexMappings[3] is 101, this means that the vertex at index 3 in the UnityEngine.Mesh is at vertex 101 in the MeshBuilder vertex array.


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