Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

class Geo::AtlasMesh

The AtlasMesh implementation used for the packer and anything else that needs not to know whether we have one mesh or several.

Functions

NameDescription
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.


Anchor
a575f9595bbc86a9b21a80d4a5588e1cf
a575f9595bbc86a9b21a80d4a5588e1cf

bool Geo::AtlasMesh::AreChartsIndependent

...

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.

Returns

True if the charts are independent, or false otherwise.


Anchor
a044072ccf07d9622363d2874f10e06e9
a044072ccf07d9622363d2874f10e06e9

static AtlasMesh* Geo::AtlasMesh::Create

...

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.


Anchor
ab6618dff6e7e98b0435f1c21efce7386
ab6618dff6e7e98b0435f1c21efce7386

static AtlasMesh* Geo::AtlasMesh::DeepCopy

...

public: AtlasMesh * DeepCopy
(
    const AtlasMesh * other
)

...

Create a clone of an AtlasMesh.


Anchor
a37f06c2558c5d8a567d4e859a46ce4f6
a37f06c2558c5d8a567d4e859a46ce4f6

bool Geo::AtlasMesh::DetectCharts

...

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.


Anchor
a8d6b44db7fb997a538593f457346689e
a8d6b44db7fb997a538593f457346689e

s32 Geo::AtlasMesh::GetCharacteristicVertex

...

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.

Returns

The index of the vertex which representative of this one.

Parameters
[in]vertexIndex

The index of the vertex to find the characteristic of.


Anchor
a15479060e5b7acee387e1eb22cd4d2c8
a15479060e5b7acee387e1eb22cd4d2c8

AtlasMeshChart* Geo::AtlasMesh::GetChart

...

public: AtlasMeshChart * GetChart
(
    s32 chartIndex
) const

...

Obtain access to one of the mesh charts.

Returns

A chart belonging to the mesh.

Parameters
[in]chartIndex

The index of the chart that is required.


Anchor
a5751faff49425e26757872bc08e9b873
a5751faff49425e26757872bc08e9b873

s32 Geo::AtlasMesh::GetChartCount

...

public: s32 GetChartCount() const

...

The number of charts that the mesh is composed of.

Returns

The number of charts.


Anchor
aaea16148a4f6ab0f5bf887c3d513450d
aaea16148a4f6ab0f5bf887c3d513450d

AtlasMeshChartingFlags Geo::AtlasMesh::GetChartingFlags

...

public: AtlasMeshChartingFlags GetChartingFlags() const

...

Return the flags used to chart this mesh.


Anchor
a03b085efa72e9f205a454b2298daf42f
a03b085efa72e9f205a454b2298daf42f

const s32* Geo::AtlasMesh::GetEdgeToEdgeAdjacencyMap

...

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.


Anchor
a4aa8c900f03a9ecf6132ea435672d469
a4aa8c900f03a9ecf6132ea435672d469

const AtlasMeshTriangle* Geo::AtlasMesh::GetTriangle

...

public: const AtlasMeshTriangle * GetTriangle
(
    s32 triangleIndex
) const

...

Obtain a mesh triangle.

Returns

Returns the specified triangle.

Parameters
[in]triangleIndex

The index of the triangle to obtain.


Anchor
aa9916a1a066f6de752de4126ec79d062
aa9916a1a066f6de752de4126ec79d062

s32 Geo::AtlasMesh::GetTriangleCount

...

public: s32 GetTriangleCount() const

...

Obtain the number of triangles in the mesh.

Returns

The number of triangles in the mesh.


Anchor
aa19cd1aefed977cdf0370714bcf8e678
aa19cd1aefed977cdf0370714bcf8e678

const s32* Geo::AtlasMesh::GetTrianglePartitioning

...

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".

Note
titleNote

Triangles can not be in a chart (ie. topological degenerates when using edge-connected chart detection)

Returns

An array of memory with one entry for each triangle in the mesh, describing which chart it is part of.


Anchor
a0a157d324ba765e25f140267432cad5d
a0a157d324ba765e25f140267432cad5d

const AtlasMeshTriangles* Geo::AtlasMesh::GetTriangles

...

public: const AtlasMeshTriangles * GetTriangles() const

...

Obtain the list of triangles.


Anchor
acf93a2228439e5abf90f0f834d208f5a
acf93a2228439e5abf90f0f834d208f5a

const AtlasMeshVertex* Geo::AtlasMesh::GetVertex

...

public: const AtlasMeshVertex * GetVertex
(
    s32 vertexIndex
) const

...

Obtain a vertex.

Returns

Returns the specified vertex.

Parameters
[in]vertexIndex

The index of the vertex in the mesh.


Anchor
a9548e8a346d32104493a4dc036f5a7c5
a9548e8a346d32104493a4dc036f5a7c5

s32 Geo::AtlasMesh::GetVertexCount

...

public: s32 GetVertexCount() const

...

Obtain the number of vertices in the mesh.

Returns

The number of vertices in the mesh.


Anchor
a290974d54c3826994ce9723cb2828080
a290974d54c3826994ce9723cb2828080

const AtlasMeshVertices* Geo::AtlasMesh::GetVertices

...

public: const AtlasMeshVertices * GetVertices() const

...

Obtain a copy of the vertices in the mesh.

Returns

A copy of the vertex list.


Anchor
a9c153efc6825def015b1ea91cdb918ae
a9c153efc6825def015b1ea91cdb918ae

bool Geo::AtlasMesh::IsChartTriangleDegenerate

...

public: bool IsChartTriangleDegenerate
(
    Geo::s32 chart,
    Geo::s32 tri
) const

...

Degeneracy testing.

(In AtlasMesh interface only)


Anchor
a78dd0367389fd30d648c8278e44a21af
a78dd0367389fd30d648c8278e44a21af

AtlasMesh* Geo::AtlasMesh::MakeChartsIndependent

...

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.

Returns

A new mesh that has been fixed in this regard.

Parameters
[inout]vertexSplitSpec

- An array of changes to the original mesh.


Anchor
abd19addc0aec811df6bc0c5b55246d08
abd19addc0aec811df6bc0c5b55246d08

void Geo::AtlasMesh::Release

...

public: void Release()

...

Release the mesh after it is finished with.


Anchor
a4e3f290a53edad751099d44383414d39
a4e3f290a53edad751099d44383414d39

bool Geo::AtlasMesh::RepackCharts

...

public: bool RepackCharts
(
    const AtlasMeshPackingFlags & params,
    IGeoProgressProxy * progress
)

...

Pack the charts into the single square in UV space spanned by (0,0) - (1,1).


Anchor
a755dbd831486276a90450f2b5035e7ff
a755dbd831486276a90450f2b5035e7ff

static AtlasMesh* Geo::AtlasMesh::SerializeFromFile

...

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.


Anchor
abfb1052f5c98e97018487eb7142c1679
abfb1052f5c98e97018487eb7142c1679

void Geo::AtlasMesh::SetVertexUV

...

public: void SetVertexUV
(
    s32 vertexIndex,
    float u,
    float v
)

...

Update the UV coordinate of a vertex.

Parameters
[in]vertexIndex

The index of the vertex which is to be modified.

[in]u

The new UV coordinates.