Page 1 of 1

ConvexHull does not have a constructor that takes indices

Posted: Wed Jan 07, 2015 1:58 pm
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

Re: ConvexHull does not have a constructor that takes indice

Posted: Wed Jan 07, 2015 7:53 pm
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.