Jolt Physics
A multi core friendly Game Physics Engine
|
A convex hull builder that tries to create 2D hulls as accurately as possible. Used for offline processing. More...
#include <ConvexHullBuilder2D.h>
Public Types | |
enum class | EResult { Success , MaxVerticesReached } |
Result enum that indicates how the hull got created. More... | |
using | Positions = Array< Vec3 > |
using | Edges = Array< int > |
Public Member Functions | |
ConvexHullBuilder2D (const Positions &inPositions) | |
~ConvexHullBuilder2D () | |
Destructor. | |
EResult | Initialize (int inIdx1, int inIdx2, int inIdx3, int inMaxVertices, float inTolerance, Edges &outEdges) |
Public Member Functions inherited from NonCopyable | |
NonCopyable ()=default | |
NonCopyable (const NonCopyable &)=delete | |
void | operator= (const NonCopyable &)=delete |
A convex hull builder that tries to create 2D hulls as accurately as possible. Used for offline processing.
using ConvexHullBuilder2D::Edges = Array<int> |
using ConvexHullBuilder2D::Positions = Array<Vec3> |
|
strong |
Result enum that indicates how the hull got created.
Enumerator | |
---|---|
Success | Hull building finished successfully. |
MaxVerticesReached | Hull building finished successfully, but the desired accuracy was not reached because the max vertices limit was reached. |
|
explicit |
Constructor
inPositions | Positions used to make the hull. Uses X and Y component of Vec3 only! |
ConvexHullBuilder2D::~ConvexHullBuilder2D | ( | ) |
Destructor.
ConvexHullBuilder2D::EResult ConvexHullBuilder2D::Initialize | ( | int | inIdx1, |
int | inIdx2, | ||
int | inIdx3, | ||
int | inMaxVertices, | ||
float | inTolerance, | ||
Edges & | outEdges | ||
) |
Takes all positions as provided by the constructor and use them to build a hull Any points that are closer to the hull than inTolerance will be discarded
inIdx1,inIdx2,inIdx3 | The indices to use as initial hull (in any order) |
inMaxVertices | Max vertices to allow in the hull. Specify INT_MAX if there is no limit. |
inTolerance | Max distance that a point is allowed to be outside of the hull |
outEdges | On success this will contain the list of indices that form the hull (counter clockwise) |