Jolt Physics
A multi core friendly Game Physics Engine
|
#include <TriangleGrouperClosestCentroid.h>
Public Member Functions | |
virtual void | Group (const VertexList &inVertices, const IndexedTriangleList &inTriangles, int inGroupSize, Array< uint > &outGroupedTriangleIndices) override |
Public Member Functions inherited from TriangleGrouper | |
virtual | ~TriangleGrouper ()=default |
Virtual destructor. More... | |
virtual void | Group (const VertexList &inVertices, const IndexedTriangleList &inTriangles, int inGroupSize, Array< uint > &outGroupedTriangleIndices)=0 |
Public Member Functions inherited from NonCopyable | |
NonCopyable ()=default | |
NonCopyable (const NonCopyable &)=delete | |
void | operator= (const NonCopyable &)=delete |
A class that groups triangles in batches of N. Starts with centroid with lowest X coordinate and finds N closest centroids, this repeats until all groups have been found. Time complexity: O(N^2)
|
overridevirtual |
Group a batch of indexed triangles
inVertices | The list of vertices |
inTriangles | The list of indexed triangles (indexes into inVertices) |
inGroupSize | How big each group should be |
outGroupedTriangleIndices | An ordered list of indices (indexing into inTriangles), contains groups of inGroupSize large worth of indices to triangles that are grouped together. If the triangle count is not an exact multiple of inGroupSize the last batch will be smaller. |
Implements TriangleGrouper.