75 bool SplitInternal(
const Range &inTriangles,
uint inDimension,
float inSplit, Range &outLeft, Range &outRight);
unsigned int uint
Definition Core.h:309
#define JPH_NAMESPACE_END
Definition Core.h:240
#define JPH_NAMESPACE_BEGIN
Definition Core.h:234
Array< Float3 > VertexList
Definition Float3.h:42
Array< IndexedTriangle > IndexedTriangleList
Definition IndexedTriangle.h:105
std::vector< T, STLAllocator< T > > Array
Definition STLAllocator.h:81
Triangle with 32-bit indices and material index.
Definition IndexedTriangle.h:69
A class that splits a triangle list into two parts for building a tree.
Definition TriangleSplitter.h:13
bool SplitInternal(const Range &inTriangles, uint inDimension, float inSplit, Range &outLeft, Range &outRight)
Helper function to split triangles based on dimension and split value.
Definition TriangleSplitter.cpp:28
Array< Float3 > mCentroids
Unsorted centroids of triangles.
Definition TriangleSplitter.h:79
virtual ~TriangleSplitter()=default
Virtual destructor.
TriangleSplitter(const VertexList &inVertices, const IndexedTriangleList &inTriangles)
Constructor.
Definition TriangleSplitter.cpp:11
const VertexList & GetVertices() const
Get the list of vertices.
Definition TriangleSplitter.h:62
const VertexList & mVertices
Vertices of the indexed triangles.
Definition TriangleSplitter.h:77
virtual void GetStats(Stats &outStats) const =0
Get stats of splitter.
virtual bool Split(const Range &inTriangles, Range &outLeft, Range &outRight)=0
const IndexedTriangleList & mTriangles
Unsorted triangles.
Definition TriangleSplitter.h:78
Array< uint > mSortedTriangleIdx
Indices to sort triangles.
Definition TriangleSplitter.h:80
const IndexedTriangle & GetTriangle(uint inIdx) const
Get triangle by index.
Definition TriangleSplitter.h:68
Range GetInitialRange() const
Range of triangles to start with.
Definition TriangleSplitter.h:49
Helper struct to indicate triangle range before and after the split.
Definition TriangleSplitter.h:32
uint mEnd
Definition TriangleSplitter.h:45
Range(uint inBegin, uint inEnd)
Definition TriangleSplitter.h:35
uint Count() const
Get number of triangles in range.
Definition TriangleSplitter.h:38
uint mBegin
Start and end index (end = 1 beyond end)
Definition TriangleSplitter.h:44
Range()=default
Constructor.
Definition TriangleSplitter.h:22
int mLeafSize
Definition TriangleSplitter.h:24
const char * mSplitterName
Definition TriangleSplitter.h:23