/** Calculate the weights of each triangle of the wrapped mesh.
* If the mesh has indices: the function will calculate the weight of those triangles.
* If the mesh has not indices: the function will consider the vertices as a triangle strip.*/
public void calculateWeights(){
distribution.clear();
VertexAttributes attributes = mesh.getVertexAttributes();
int indicesCount = mesh.getNumIndices();
int vertexCount = mesh.getNumVertices();
int vertexSize = (short)(attributes.vertexSize / 4),
positionOffset = (short)(attributes.findByUsage(Usage.Position).offset/4);
float[] vertices = new float[vertexCount*vertexSize];
mesh.getVertices(vertices);
if(indicesCount > 0){
short[] indices = new short[indicesCount];
mesh.getIndices(indices);