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:
A set of identified charts, with a list of triangle indices for each.
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:
They share vertices and therefore cannot be separated
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
Functions
Name | Description |
|---|---|
Create a tri group selection. | |
Explicitly construct a TriGroupSelection from ready-made arrays. | |
Gets the chart tag for the given TriGroup index. | |
Gets the group type for the given TriGroup index. | |
Get the number of tri groups. | |
Returns the number of tris in the tri group specified by groupIdx. | |
Access the array of group indices with the same length and format as the vertex buffer Will be null if numVertices was 0. | |
The length of the per vertex group idx array. | |
Get an array of triangle indices that comprise the group. | |
Release the object. | |
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). |