set hull from vertex format

The user can create a convex hull from a vertex format, not directly from a list of vertices. That's interesting because in some 3D engines convex hulls are typically created from a render mesh that might structure a vertex in different ways in the memory.
This commit is contained in:
Irlan
2018-09-04 17:52:17 -03:00
parent 4bef8b11d2
commit 6486770fc1
5 changed files with 34 additions and 27 deletions

View File

@ -42,11 +42,13 @@ struct b3QHull : public b3Hull
centroid.SetZero();
}
// Create a convex hull from an array of points.
// Create a convex hull from vertex data.
// If the creation has failed then this convex hull is not modified.
// If the flag simplify is set to true then the convex hull is simplified after
// initial construction.
void Set(const b3Vec3* points, u32 count, bool simplify = true);
// vertexStride - size of bytes between vertices
// vertexBase - pointer to the first vertex
// vertexCount - number of vertices
// simplify - if set to true the convex hull is simplified after initial construction
void Set(u32 vertexStride, const void* vertexBase, u32 vertexCount, bool simplify = true);
// Set this hull as a sphere located at the origin
// given the radius.