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:
-
sourceIndex | The index of the vertex to add in builder . |
builder | The MeshBuilder to add from. |
partIndices | Index data for this part. |
partVerts | Vertex data for this part. |
partNormals | Normals data for this part. |
partColours | Colours data for this part. |
partUVs | UV 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:
-
builder | The owning builder object. |
void Tes::Runtime::MeshBuilder::PartDetails::UpdateNormals |
( |
MeshBuilder |
builder | ) |
[inline] |
Updates used normals by copying mapped normals from builder .
- Parameters:
-
builder | The owning builder object. |
void Tes::Runtime::MeshBuilder::PartDetails::UpdateUVs |
( |
MeshBuilder |
builder | ) |
[inline] |
Updates used uvs by copying mapped uvs from builder .
- Parameters:
-
builder | The owning builder object. |
void Tes::Runtime::MeshBuilder::PartDetails::UpdateVertices |
( |
MeshBuilder |
builder | ) |
[inline] |
Updates used vertices by copying mapped vertices from builder .
- Parameters:
-
builder | The 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:
-
indexIndex | The 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:
-
firstIndexIndex | The first source data index to test. |
count | The 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:
-
vertexIndex | The 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:
-
firstVertexIndex | The first source data index to test. |
count | The 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?
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: