The AtlasMesh implementation used for the packer and anything else that needs not to know whether we have one mesh or several.
Name | Description |
---|---|
AreChartsIndependent() | Report on the independence of the charts, that is whether no vertex belongs to more than one chart. |
Create(const AtlasMeshVertices *, const AtlasMeshTriangles *) | Create a new instance of an AtlasMesh, instantiating it with a copy of the vertex and triangle list. |
DeepCopy(const AtlasMesh *) | Create a clone of an AtlasMesh. |
DetectCharts(const AtlasMeshChartingFlags &) | Chart Dependency. |
GetCharacteristicVertex(s32) | A mesh can have a number of vertices which whilst topologically distinct have exactly the same 3D and UV coordinates. |
GetChart(s32) | Obtain access to one of the mesh charts. |
GetChartCount() | The number of charts that the mesh is composed of. |
GetChartingFlags() | Return the flags used to chart this mesh. |
GetEdgeToEdgeAdjacencyMap() | The adjacency data is a list of edges that map to their neighbours. |
GetTriangle(s32) | Obtain a mesh triangle. |
GetTriangleCount() | Obtain the number of triangles in the mesh. |
GetTrianglePartitioning() | Return an array that specifies which triangle is in which chart. |
GetTriangles() | Obtain the list of triangles. |
GetVertex(s32) | Obtain a vertex. |
GetVertexCount() | Obtain the number of vertices in the mesh. |
GetVertices() | Obtain a copy of the vertices in the mesh. |
IsChartTriangleDegenerate(Geo::s32, Geo::s32) | Degeneracy testing. |
MakeChartsIndependent(GeoArray< AtlasMeshVertexSplitResult > *) | Make the charts independent by duplicating vertices which are shared by more than one chart, and relinking any triangles to the new vertices as necessary. |
Release() | Release the mesh after it is finished with. |
RepackCharts(const AtlasMeshPackingFlags &, IGeoProgressProxy *) | Pack the charts into the single square in UV space spanned by (0,0) - (1,1). |
SerializeFromFile(FILE *) | Serialize this mesh from file - note that this does not include any of the charting information. |
SetVertexUV(s32, float, float) | Update the UV coordinate of a vertex. |
public: bool AreChartsIndependent() const
Report on the independence of the charts, that is whether no vertex belongs to more than one chart.
Outputs problem cases to LOG_INFO.
True if the charts are independent, or false otherwise.
public: AtlasMesh * Create
(
const AtlasMeshVertices * vertices,
const AtlasMeshTriangles * triangles
)
Create a new instance of an AtlasMesh, instantiating it with a copy of the vertex and triangle list.
public: AtlasMesh * DeepCopy
(
const AtlasMesh * other
)
Create a clone of an AtlasMesh.
public: bool DetectCharts
(
const AtlasMeshChartingFlags & chartingFlags
)
Chart Dependency.
All charts need to be independent of each other in UV space, so that they can be individually parametrised and packed. In order to do this some vertices might need to be duplicated, and the triangles that use them might have to have their corners relinked to the new copy. Parse the mesh structure and populate the charts.
public: s32 GetCharacteristicVertex
(
s32 vertexIndex
) const
A mesh can have a number of vertices which whilst topologically distinct have exactly the same 3D and UV coordinates.
A map of these characteristically identical vertices is maintained internally, which identifies them all with one of them through its vertex index. XXX Should this be in the private interface. It's only used XXX internally, and by the parametriser as far as I know.
The index of the vertex which representative of this one.
[in] | vertexIndex | The index of the vertex to find the characteristic of. |
public: AtlasMeshChart * GetChart
(
s32 chartIndex
) const
Obtain access to one of the mesh charts.
A chart belonging to the mesh.
[in] | chartIndex | The index of the chart that is required. |
public: s32 GetChartCount() const
The number of charts that the mesh is composed of.
The number of charts.
public: AtlasMeshChartingFlags GetChartingFlags() const
Return the flags used to chart this mesh.
public: const s32 * GetEdgeToEdgeAdjacencyMap() const
The adjacency data is a list of edges that map to their neighbours.
If they don't map to a neighbouring edge, it stores -1, otherwise it stores the neighbour's's index.
public: const AtlasMeshTriangle * GetTriangle
(
s32 triangleIndex
) const
Obtain a mesh triangle.
Returns the specified triangle.
[in] | triangleIndex | The index of the triangle to obtain. |
public: s32 GetTriangleCount() const
Obtain the number of triangles in the mesh.
The number of triangles in the mesh.
public: const s32 * GetTrianglePartitioning() const
Return an array that specifies which triangle is in which chart.
The array is number of triangles long, but may be null. It is non-null after DetectCharts() has been successfully called. Each element is the index of the charts this tri is in, or a negative number for "not in any chart".
Triangles can not be in a chart (ie. topological degenerates when using edge-connected chart detection) |
An array of memory with one entry for each triangle in the mesh, describing which chart it is part of.
public: const AtlasMeshTriangles * GetTriangles() const
Obtain the list of triangles.
public: const AtlasMeshVertex * GetVertex
(
s32 vertexIndex
) const
Obtain a vertex.
Returns the specified vertex.
[in] | vertexIndex | The index of the vertex in the mesh. |
public: s32 GetVertexCount() const
Obtain the number of vertices in the mesh.
The number of vertices in the mesh.
public: const AtlasMeshVertices * GetVertices() const
Obtain a copy of the vertices in the mesh.
A copy of the vertex list.
public: bool IsChartTriangleDegenerate
(
Geo::s32 chart,
Geo::s32 tri
) const
Degeneracy testing.
(In AtlasMesh interface only)
public: AtlasMesh * MakeChartsIndependent
(
GeoArray< AtlasMeshVertexSplitResult > * vertexSplitSpec
) const
Make the charts independent by duplicating vertices which are shared by more than one chart, and relinking any triangles to the new vertices as necessary.
A new mesh that has been fixed in this regard.
[inout] | vertexSplitSpec | - An array of changes to the original mesh. |
public: void Release()
Release the mesh after it is finished with.
public: bool RepackCharts
(
const AtlasMeshPackingFlags & params,
IGeoProgressProxy * progress
)
Pack the charts into the single square in UV space spanned by (0,0) - (1,1).
public: AtlasMesh * SerializeFromFile
(
FILE * f
)
Serialize this mesh from file - note that this does not include any of the charting information.
It will be in the same state as if you had called Create(...) with the vertices and triangles of this mesh.
public: void SetVertexUV
(
s32 vertexIndex,
float u,
float v
)
Update the UV coordinate of a vertex.
[in] | vertexIndex | The index of the vertex which is to be modified. |
[in] | u | The new UV coordinates. |