TriangleGrouperClosestCentroid.h 638 B

1234567891011121314151617181920
  1. // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
  2. // SPDX-License-Identifier: MIT
  3. #pragma once
  4. #include <TriangleGrouper/TriangleGrouper.h>
  5. namespace JPH {
  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, vector<uint> &outGroupedTriangleIndices) override;
  14. };
  15. } // JPH