3 ComputeSubsets
Chuck Walbourn редактировал(а) эту страницу 2022-01-20 17:34:24 -08:00
DirectXMesh

Returns a list of face offsets and counts based on the input attributes id array.

std::vector<std::pair<size_t,size_t>> ComputeSubsets(
    const uint32_t* attributes, size_t nFaces );

Return values

The result is a std::vector of value pairs (as a std::pair<size_t,size_t>) where each first value is the offset in the faces array for the start of the attribute subset, and second is the number of faces in that attribute subset.

Remark

For a sorted attribute array, it returns a minimum length list of subsets which covers all faces.

Example

uint32_t cubeAttributes[ 12 ] = { 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 5, 5 };

auto subsets = ComputeSubsets( cubeAttributes, 12 );

// subsets contains 5 pairs: <0, 2>, <2, 2>, <4, 2>, <6, 4>, <10, 2>