TriangleGrouperClosestCentroid.h 656 B

1234567891011121314151617181920
  1. // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
  2. // SPDX-License-Identifier: MIT
  3. #pragma once
  4. #include <Jolt/TriangleGrouper/TriangleGrouper.h>
  5. JPH_NAMESPACE_BEGIN
  6. /// A class that groups triangles in batches of N.
  7. /// Starts with centroid with lowest X coordinate and finds N closest centroids, this repeats until all groups have been found.
  8. /// Time complexity: O(N^2)
  9. class TriangleGrouperClosestCentroid : public TriangleGrouper
  10. {
  11. public:
  12. // See: TriangleGrouper::Group
  13. virtual void Group(const VertexList &inVertices, const IndexedTriangleList &inTriangles, int inGroupSize, Array<uint> &outGroupedTriangleIndices) override;
  14. };
  15. JPH_NAMESPACE_END