|
JPL Spatial
Sound spatialization and propagation library
|
#include <JPLSpatial/Geometry/ConvexHullBuilder.h>
Classes | |
| class | Edge |
| Class that holds the information of an edge. More... | |
| class | Face |
| Class that holds the information of one face. More... | |
Public Types | |
| enum class | EResult { Success , MaxVerticesReached , TooFewPoints , TooFewFaces , Degenerate } |
| Result enum that indicates how the hull got created. More... | |
| using | ConflictList = Array< int > |
| using | Positions = std::span< const Vec3 > |
| using | Faces = Array< Face * > |
Public Member Functions | |
| ConvexHullBuilder (Positions inPositions) | |
| ~ConvexHullBuilder () | |
| EResult | Initialize (int inMaxVertices, float inTolerance, const char *&outError) |
| int | GetNumVerticesUsed () const |
| Returns the amount of vertices that are currently used by the hull. | |
| bool | ContainsFace (const Array< int > &inIndices) const |
| Returns true if the hull contains a polygon with inIndices (counter clockwise indices in mPositions) | |
| const Faces & | GetFaces () const |
| Access to the created faces. Memory is owned by the convex hull builder. | |
| template<class Vec3i > | |
| void | GetTriangles (Array< Vec3i > &outTris) |
Class to generate convex hull from a list of points, suitable for generating speaker mesh for VBAP.
Note: This is a slightly modified version of ConvexHullBuilder from JoltPhysics library
| using JPL::ConvexHullBuilder< Vec3Type >::ConflictList = Array<int> |
| using JPL::ConvexHullBuilder< Vec3Type >::Faces = Array<Face*> |
| using JPL::ConvexHullBuilder< Vec3Type >::Positions = std::span<const Vec3> |
|
strong |
Result enum that indicates how the hull got created.
|
inline |
|
inline |
|
inline |
Returns true if the hull contains a polygon with inIndices (counter clockwise indices in mPositions)
|
inline |
Access to the created faces. Memory is owned by the convex hull builder.
|
inline |
Returns the amount of vertices that are currently used by the hull.
|
inline |
Get triangle indices for all faces in the hull. Note: any faces that are polygons will be triangulated.
|
inline |
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
| 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 |
| outError | Error message when building fails |
Coplanar hull is invalid for 3D VBAP