}
private static final PrimComparator primComp = new PrimComparator();
public static void generateStrips(Mesh mesh, boolean stitch, boolean listOnly, int cacheSize, int minStripSize){
TriStrip ts = new TriStrip();
ts.setStitchStrips(stitch);
ts.setCacheSize(cacheSize);
ts.setListsOnly(listOnly);
ts.setMinStripSize(minStripSize);
IndexBuffer ib = mesh.getIndicesAsList();
int[] indices = new int[ib.size()];
for (int i = 0; i < indices.length; i++)
indices[i] = ib.get(i);
PrimitiveGroup[] groups = ts.generateStrips(indices);
Arrays.sort(groups, primComp);
int numElements = 0;
for (PrimitiveGroup group : groups)
numElements += group.numIndices;