C4 Engine Terathon Software C4 Engine API Documentation

• World Manager

API Links
Developer Links

GeometryLevel::UnifyGeometryLevel

Defined in:  C4GeometryLevel.h
Unifies duplicate vertices in a geometry level.
Prototype

void UnifyGeometryLevel(const GeometryLevel *inputLevel);

Parameters
geometryLevel The input geometry level.
Description
The UnifyGeometryLevel function searches for pairs of vertices in the same surface that have identical positions, normal vectors, colors, and texture coordinates. Duplicates are removed, and index data in the face array is remapped. If the normal array or color array does not exist, then the unification proceeds without considering normals and/or colors.

If the input geometry level has a 4D tangent array, then two vertices are considered to be distinct if the w coordinates of the tangents are not the same or the 3D dot product between the tangents is not positive. When the UnifyGeometryLevel function returns, the geometry level no longer has a tangent array, so the GeometryLevel::BuildTangentArray function must be called to generate a new tangent array for the unified geometry level.
See Also

GeometryLevel::WeldGeometryLevel

GeometryLevel::MendGeometryLevel

GeometryLevel::BuildTangentArray