Jolt Physics
A multi core friendly Game Physics Engine
|
A convex hull builder specifically made for the EPA penetration depth calculation. It trades accuracy for speed and will simply abort of the hull forms defects due to numerical precision problems. More...
#include <EPAConvexHullBuilder.h>
Classes | |
class | Edge |
Class that holds the information of an edge. More... | |
class | Points |
Specialized points list that allows direct access to the size. More... | |
class | Triangle |
Class that holds the information of one triangle. More... | |
class | TriangleFactory |
Factory that creates triangles in a fixed size buffer. More... | |
class | TriangleQueue |
Specialized triangles list that keeps them sorted on closest distance to origin. More... | |
Public Types | |
using | Edges = StaticArray< Edge, cMaxEdgeLength > |
using | NewTriangles = StaticArray< Triangle *, cMaxEdgeLength > |
using | PointsBase = StaticArray< Vec3, cMaxPoints > |
using | Triangles = StaticArray< Triangle *, cMaxTriangles > |
Public Member Functions | |
EPAConvexHullBuilder (const Points &inPositions) | |
Constructor. More... | |
void | Initialize (int inIdx1, int inIdx2, int inIdx3) |
Initialize the hull with 3 points. More... | |
bool | HasNextTriangle () const |
Check if there's another triangle to process from the queue. More... | |
Triangle * | PeekClosestTriangleInQueue () |
Access to the next closest triangle to the origin (won't remove it from the queue). More... | |
Triangle * | PopClosestTriangleFromQueue () |
Access to the next closest triangle to the origin and remove it from the queue. More... | |
Triangle * | FindFacingTriangle (Vec3Arg inPosition, float &outBestDistSq) |
bool | AddPoint (Triangle *inFacingTriangle, int inIdx, float inClosestDistSq, NewTriangles &outTriangles) |
Add a new point to the convex hull. More... | |
void | FreeTriangle (Triangle *inT) |
Free a triangle. More... | |
Public Member Functions inherited from NonCopyable | |
NonCopyable ()=default | |
NonCopyable (const NonCopyable &)=delete | |
void | operator= (const NonCopyable &)=delete |
Static Public Attributes | |
static constexpr int | cMaxTriangles = 256 |
Max triangles in hull. More... | |
static constexpr int | cMaxPoints = cMaxTriangles / 2 |
Max number of points in hull. More... | |
static constexpr int | cMaxEdgeLength = 128 |
Max number of edges in FindEdge. More... | |
static constexpr float | cMinTriangleArea = 1.0e-10f |
Minimum area of a triangle before, if smaller than this it will not be added to the priority queue. More... | |
static constexpr float | cBarycentricEpsilon = 1.0e-3f |
Epsilon value used to determine if a point is in the interior of a triangle. More... | |
A convex hull builder specifically made for the EPA penetration depth calculation. It trades accuracy for speed and will simply abort of the hull forms defects due to numerical precision problems.
|
inlineexplicit |
Constructor.
|
inline |
Add a new point to the convex hull.
|
inline |
Find the triangle on which inPosition is the furthest to the front Note this function works as long as all points added have been added with AddPoint(..., FLT_MAX).
|
inline |
Free a triangle.
|
inline |
Check if there's another triangle to process from the queue.
|
inline |
Initialize the hull with 3 points.
|
inline |
Access to the next closest triangle to the origin (won't remove it from the queue).
|
inline |
Access to the next closest triangle to the origin and remove it from the queue.
|
staticconstexpr |
Epsilon value used to determine if a point is in the interior of a triangle.
|
staticconstexpr |
Max number of edges in FindEdge.
|
staticconstexpr |
Max number of points in hull.
|
staticconstexpr |
Max triangles in hull.
|
staticconstexpr |
Minimum area of a triangle before, if smaller than this it will not be added to the priority queue.