class Geo TriGroupSelection

This is the documentation for Enlighten.

class Geo TriGroupSelection

class Geo::TriGroupSelection

Utility for doing vertex-based chart identification.

This is the code used as part of the precompute for identifying the tri groups (aka charts) in an Enlighten::IPrecompInputMesh mesh for mesh projection and packing into lightmaps. It identifies tri groups based on the index buffer and a set of explicit links. It holds the chart information in two forms for convenience:

  1. A set of identified charts, with a list of triangle indices for each.

  2. An array of chart indices to match the vertex array.

 

A triangle group is any group of triangles that do not share vertices with any other group. This definition allows us to operate on groups independently without having to worry about the changes to one group affecting another.

There are two reasons triangles may be joined together into the same group:

  1. They share vertices and therefore cannot be separated

  2. They reference vertices that are explicitly linked together

 

The index buffer specifies all the information we need to determine which vertices are between triangles. Additional explicit links can also be added as an array of index pairs. The explicit links allow an opportunity to remove any unnecessary vertex duplication that may exist, such as vertices being duplicated to incorporate additional irrelevant data. Note that the actual vertex data is not required.

Variables

Name

Description

Name

Description

const Geo::u8 groupTypeNormal = 0

Group type constants.

const Geo::u8 groupTypeSmoothBevel = 1

Group type constants.

Functions

Name

Description

Name

Description

Create(const Geo::s32, const Geo::s32 *, Geo::s32, const IdxLink *, Geo::s32, const Geo::s16 *, const Geo::u8 *)

Create a tri group selection.

CreateExplicit(const Geo::s32, const Geo::s32, Geo::s32 *, Geo::s32 *, Geo::s32 *, Geo::s32 *, Geo::s16 *, Geo::u8 *)

Explicitly construct a TriGroupSelection from ready-made arrays.

GetChartTagForGroupIdx(Geo::s32)

Gets the chart tag for the given TriGroup index.

GetGroupTypeForGroupIdx(Geo::s32)

Gets the group type for the given TriGroup index.

GetNumTriGroups()

Get the number of tri groups.

GetNumTrisInGroupIdx(Geo::s32)

Returns the number of tris in the tri group specified by groupIdx.

GetPerVertexGroupIdxArray()

Access the array of group indices with the same length and format as the vertex buffer Will be null if numVertices was 0.

GetPerVertexGroupIdxArrayLength()

The length of the per vertex group idx array.

GetTriIdxArrayForGroupIdx(Geo::s32)

Get an array of triangle indices that comprise the group.

Release()

Release the object.

SetGroupTypeForGroupIdx(Geo::s32, Geo::u8)

Sets the group type for the given TriGroup index.



static TriGroupSelection* Geo::TriGroupSelection::Create


public: TriGroupSelection * Create
(
    const Geo::s32 numVertices,
    const Geo::s32 * indexBuffer,
    Geo::s32 numIndices,
    const IdxLink * linkBuffer,
    Geo::s32 numLinks,
    const Geo::s16 * chartTags,
    const Geo::u8 * faceTypes
)


Create a tri group selection.

 

Parameters

[in]

numVertices

Must be zero or positive and larger than any index referenced by indexBuffer. Zero will succeed but contain no groups.

[in]

indexBuffer

Array of indices to the vertex buffer. Can be null only if numVertices == numIndices == 0. Length should match numIndices.

[in]

numIndices

Length of indexBuffer. Zero will succeed contain no groups.

[in]

linkBuffer

Optional if numLinks == 0. An array of vertex index pairs to explicitly link.

[in]

numLinks

The length of linkBuffer, or 0 for no links.

[in]

chartTags

Array of user tags specified per face, can be NULL. Used to identify charts and to control auto UV generation and mesh projection.

[in]

faceTypes

Array of face types, can be NULL. Used to identify different types of faces (i.e. bevel faces).