TriangleGrouperClosestCentroid.h 720 B

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