Plasma Engine  2.0
Loading...
Searching...
No Matches
plConvexHullGenerator Class Reference

Computes convex hulls for 3D meshes. More...

#include <ConvexHull.h>

Classes

struct  Face
 

Public Member Functions

void SetSimplificationMinTriangleAngle (plAngle angle)
 Used to remove degenerate and unnecessary triangles that have corners with very little angle change. Ie. specifying 10 degree, means that all triangle corners must have at least a 10 degree change (and inner angle of 170 degree). Default is 22 degree.
 
void SetSimplificationFlatVertexNormalThreshold (plAngle angle)
 Used to remove vertices that do not contribute much to the silhouette. Vertices whose adjacent triangle normals do not differ by more than angle, will be discarded. Default is 5 degree.
 
void SetSimplificationMinTriangleEdgeLength (double fLen)
 The minimum triangle edge length. Every edge shorter than this will be discarded and replaced by a single vertex at the average position.
 
plResult Build (const plArrayPtr< const plVec3 > vertices)
 Generates the convex hull. Simplifies the mesh according to the previously specified parameters.
 
void Retrieve (plDynamicArray< plVec3 > &out_vertices, plDynamicArray< Face > &out_faces)
 When Build() was successful this can be called to retrieve the resulting vertices and triangles.
 
void RetrieveVertices (plDynamicArray< plVec3 > &out_vertices)
 Same as Retrieve() but only returns the vertices.
 

Detailed Description

Computes convex hulls for 3D meshes.

By default it will also simplify the result to a reasonable degree, to reduce complexity and vertex/triangle count.

Currently there is an upper limit of 16384 vertices to accept meshes. Everything larger than that will not be processed.

Member Function Documentation

◆ SetSimplificationMinTriangleEdgeLength()

void plConvexHullGenerator::SetSimplificationMinTriangleEdgeLength ( double fLen)
inline

The minimum triangle edge length. Every edge shorter than this will be discarded and replaced by a single vertex at the average position.

Note
The length is not in 'mesh space' coordinates, but instead in 'unit cube space'. That means, every mesh is scaled to fit into a cube of size [-1; +1] for each axis. Thus the exact scale of the mesh does not matter when setting this value. Default is 0.05.

The documentation for this class was generated from the following files: