A convex hull builder that tries to create hulls as accurately as possible. Used for offline processing.
More...
#include <ConvexHullBuilder.h>
|
| class | Edge |
| | Class that holds the information of an edge. More...
|
| |
| class | Face |
| | Class that holds the information of one face. More...
|
| |
A convex hull builder that tries to create hulls as accurately as possible. Used for offline processing.
◆ ConflictList
◆ Faces
◆ Positions
◆ EResult
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.
|
| TooFewPoints | Too few points to create a hull.
|
| TooFewFaces | Too few faces in the created hull (signifies precision errors during building)
|
| Degenerate | Degenerate hull detected.
|
◆ ConvexHullBuilder()
| ConvexHullBuilder::ConvexHullBuilder |
( |
const Positions & |
inPositions | ) |
|
|
explicit |
◆ ~ConvexHullBuilder()
| ConvexHullBuilder::~ConvexHullBuilder |
( |
| ) |
|
|
inline |
◆ ContainsFace()
| bool ConvexHullBuilder::ContainsFace |
( |
const Array< int > & |
inIndices | ) |
const |
Returns true if the hull contains a polygon with inIndices (counter clockwise indices in mPositions)
◆ DetermineMaxError()
| void ConvexHullBuilder::DetermineMaxError |
( |
Face *& |
outFaceWithMaxError, |
|
|
float & |
outMaxError, |
|
|
int & |
outMaxErrorPositionIdx, |
|
|
float & |
outCoplanarDistance |
|
) |
| const |
Determines the point that is furthest outside of the hull and reports how far it is outside of the hull (which indicates a failure during hull building)
- Parameters
-
| outFaceWithMaxError | The face that caused the error |
| outMaxError | The maximum distance of a point to the hull |
| outMaxErrorPositionIdx | The index of the point that had this distance |
| outCoplanarDistance | Points that are less than this distance from the hull are considered on the hull. This should be used as a lowerbound for the allowed error. |
◆ GetCenterOfMassAndVolume()
| void ConvexHullBuilder::GetCenterOfMassAndVolume |
( |
Vec3 & |
outCenterOfMass, |
|
|
float & |
outVolume |
|
) |
| const |
Calculate the center of mass and the volume of the current convex hull.
◆ GetFaces()
| const Faces & ConvexHullBuilder::GetFaces |
( |
| ) |
const |
|
inline |
Access to the created faces. Memory is owned by the convex hull builder.
◆ GetNumVerticesUsed()
| int ConvexHullBuilder::GetNumVerticesUsed |
( |
| ) |
const |
Returns the amount of vertices that are currently used by the hull.
◆ Initialize()
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
- Parameters
-
| 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 |
- Returns
- Status code that reports if the hull was created or not
The documentation for this class was generated from the following files: