41 EResult Initialize(
int inIdx1,
int inIdx2,
int inIdx3,
int inMaxVertices,
float inTolerance,
Edges &outEdges);
44#ifdef JPH_CONVEX_BUILDER_2D_DEBUG
46 static constexpr Real cDrawScale = 10;
57 void AssignPointToEdge(
int inPositionIdx,
const Array<Edge *> &inEdges)
const;
59#ifdef JPH_CONVEX_BUILDER_2D_DEBUG
64#ifdef JPH_ENABLE_ASSERTS
66 void ValidateEdges()
const;
78 explicit Edge(
int inStartIdx) : mStartIdx(inStartIdx) { }
81 void CalculateNormalAndCenter(
const Vec3 *inPositions);
84 inline bool IsFacing(
Vec3Arg inPosition)
const {
return mNormal.
Dot(inPosition - mCenter) > 0.0f; }
88 ConflictList mConflictList;
89 Edge * mPrevEdge =
nullptr;
90 Edge * mNextEdge =
nullptr;
92 float mFurthestPointDistanceSq = 0.0f;
96 Edge * mFirstEdge =
nullptr;
99#ifdef JPH_CONVEX_BUILDER_2D_DEBUG
#define JPH_NAMESPACE_END
Definition Core.h:240
#define JPH_NAMESPACE_BEGIN
Definition Core.h:234
#define JPH_OVERRIDE_NEW_DELETE
Macro to override the new and delete functions.
Definition Memory.h:29
float Real
Definition Real.h:27
std::vector< T, STLAllocator< T > > Array
Definition STLAllocator.h:81
A convex hull builder that tries to create 2D hulls as accurately as possible. Used for offline proce...
Definition ConvexHullBuilder2D.h:15
EResult
Result enum that indicates how the hull got created.
Definition ConvexHullBuilder2D.h:29
@ Success
Hull building finished successfully.
@ MaxVerticesReached
Hull building finished successfully, but the desired accuracy was not reached because the max vertice...
Array< int > Edges
Definition ConvexHullBuilder2D.h:18
Array< Vec3 > Positions
Definition ConvexHullBuilder2D.h:17
~ConvexHullBuilder2D()
Destructor.
Definition ConvexHullBuilder2D.cpp:59
EResult Initialize(int inIdx1, int inIdx2, int inIdx3, int inMaxVertices, float inTolerance, Edges &outEdges)
Definition ConvexHullBuilder2D.cpp:151
ConvexHullBuilder2D(const Positions &inPositions)
Definition ConvexHullBuilder2D.cpp:32
Class that makes another class non-copyable. Usage: Inherit from NonCopyable.
Definition NonCopyable.h:11
JPH_INLINE float Dot(Vec3Arg inV2) const
Dot product.
Definition Vec3.inl:637