Browse Source

Doc++

pull/7/head
Vladimír Vondruš 14 years ago
parent
commit
42f5ee4ce4
  1. 12
      src/MeshTools/CombineIndexedArrays.h
  2. 6
      src/MeshTools/CompressIndices.h

12
src/MeshTools/CombineIndexedArrays.h

@ -92,7 +92,7 @@ class CombineIndexedArrays {
/**
@brief Combine indexed arrays
@param[in,out] indexedArrays Index and attribute arrays
@return Array with resulting indices
@return %Array with resulting indices
When you have e.g. vertex, normal and texture array, each indexed with
different indices, you can use this function to combine them to use the same
@ -120,13 +120,11 @@ std::vector<std::uint32_t> indices = MeshTools::combineIndexedArrays(
`positions`, `normals` and `textureCoordinates` will then contain combined
attributes indexed with `indices`.
@attention All index arrays should have the same size, otherwise zero-length
output is generated.
@internal Implementation note: It's done using tuples because it is more clear
which parameter is index array and which is attribute array, mainly when
both are of the same type.
The function expects that all arrays have the same size.
*/
/* Implementation note: It's done using tuples because it is more clear which
parameter is index array and which is attribute array, mainly when both are
of the same type. */
template<class ...T> std::vector<std::uint32_t> combineIndexedArrays(const std::tuple<const std::vector<std::uint32_t>&, std::vector<T>&>&... indexedArrays) {
return Implementation::CombineIndexedArrays()(indexedArrays...);
}

6
src/MeshTools/CompressIndices.h

@ -41,15 +41,15 @@ sufficient. Size of the buffer can be computed from index count and type, as
shown below. Example usage:
@code
std::size_t indexCount;
Type indexType;
IndexedMesh::IndexType indexType;
char* data;
std::tie(indexCount, indexType, data) = MeshTools::compressIndices(indices);
std::size_t dataSize = indexCount*TypeInfo::sizeOf(indexType);
std::size_t dataSize = indexCount*IndexedMesh::indexSize(indexType);
// ...
delete[] data;
@endcode
See also compressIndices(IndexedMesh*, Buffer::Usage, const std::vector<std::uint32_t>&),
See also compressIndices(IndexedMesh*, Buffer*, Buffer::Usage, const std::vector<std::uint32_t>&),
which writes the compressed data directly into index buffer of given mesh.
*/
std::tuple<std::size_t, IndexedMesh::IndexType, char*> MAGNUM_MESHTOOLS_EXPORT compressIndices(const std::vector<std::uint32_t>& indices);

Loading…
Cancel
Save