ConvexHull does not have a constructor that takes indices

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
wmcroberts3
Posts: 2
Joined: Wed Jan 07, 2015 1:44 pm

ConvexHull does not have a constructor that takes indices

Post by wmcroberts3 »

In stepping forward to get an imported fbx Model represented by a ConvexHull, I am using the ModelDataExtractor from the demos. However, this pulls both vertices and indices from the model and it appears the ConvexHull constructors only take vertices. Is there a similar helper method out there that would do the heavy lifting in getting a correct representation of a Model's vertices only?

Thanks,
Bill
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: ConvexHull does not have a constructor that takes indice

Post by Norbo »

The ConvexHullShape only cares about unique vertices on the surface of the convex hull, so passing in the vertices list that is associated with the index buffer is perfectly fine. In fact, the index-associated list of vertices will tend to have less redundant entries than the pure vertex list representation of a mesh, so it's even recommended.

Do be careful with the number of vertices within a convex hull shape, though. For optimal performance, the number of vertices in the final ConvexHullShape should be very low; 20 or less is a good rule of thumb.
Post Reply