Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
TriangleSplitterFixedLeafSize Class Reference

#include <TriangleSplitterFixedLeafSize.h>

Inheritance diagram for TriangleSplitterFixedLeafSize:
TriangleSplitter NonCopyable

Public Member Functions

 TriangleSplitterFixedLeafSize (const VertexList &inVertices, const IndexedTriangleList &inTriangles, uint inLeafSize, uint inMinNumBins=8, uint inMaxNumBins=128, uint inNumTrianglesPerBin=6)
 Constructor.
 
virtual void GetStats (Stats &outStats) const override
 Get stats of splitter.
 
virtual bool Split (const Range &inTriangles, Range &outLeft, Range &outRight) override
 
- Public Member Functions inherited from TriangleSplitter
 TriangleSplitter (const VertexList &inVertices, const IndexedTriangleList &inTriangles)
 Constructor.
 
virtual ~TriangleSplitter ()=default
 Virtual destructor.
 
Range GetInitialRange () const
 Range of triangles to start with.
 
const VertexListGetVertices () const
 Get the list of vertices.
 
const IndexedTriangleGetTriangle (uint inIdx) const
 Get triangle by index.
 
- Public Member Functions inherited from NonCopyable
 NonCopyable ()=default
 
 NonCopyable (const NonCopyable &)=delete
 
void operator= (const NonCopyable &)=delete
 

Additional Inherited Members

- Protected Member Functions inherited from TriangleSplitter
bool SplitInternal (const Range &inTriangles, uint inDimension, float inSplit, Range &outLeft, Range &outRight)
 Helper function to split triangles based on dimension and split value.
 
- Protected Attributes inherited from TriangleSplitter
const VertexListmVertices
 Vertices of the indexed triangles.
 
const IndexedTriangleListmTriangles
 Unsorted triangles.
 
Array< Float3mCentroids
 Unsorted centroids of triangles.
 
Array< uintmSortedTriangleIdx
 Indices to sort triangles.
 

Detailed Description

Same as TriangleSplitterBinning, but ensuring that leaves have a fixed amount of triangles The resulting tree should be suitable for processing on GPU where we want all threads to process an equal amount of triangles

Constructor & Destructor Documentation

◆ TriangleSplitterFixedLeafSize()

JPH_NAMESPACE_BEGIN TriangleSplitterFixedLeafSize::TriangleSplitterFixedLeafSize ( const VertexList inVertices,
const IndexedTriangleList inTriangles,
uint  inLeafSize,
uint  inMinNumBins = 8,
uint  inMaxNumBins = 128,
uint  inNumTrianglesPerBin = 6 
)

Constructor.

Member Function Documentation

◆ GetStats()

virtual void TriangleSplitterFixedLeafSize::GetStats ( Stats outStats) const
inlineoverridevirtual

Get stats of splitter.

Implements TriangleSplitter.

◆ Split()

bool TriangleSplitterFixedLeafSize::Split ( const Range inTriangles,
Range outLeft,
Range outRight 
)
overridevirtual

Split triangles into two groups left and right, returns false if no split could be made

Parameters
inTrianglesThe range of triangles (in mSortedTriangleIdx) to process
outLeftOn return this will contain the ranges for the left subpart. mSortedTriangleIdx may have been shuffled.
outRightOn return this will contain the ranges for the right subpart. mSortedTriangleIdx may have been shuffled.
Returns
Returns true when a split was found

Implements TriangleSplitter.


The documentation for this class was generated from the following files: