/** * Computes the lods and bake them into the mesh<br> * * This method must be fed with the reduction method * {@link TriangleReductionMethod} and a list of reduction values.<br> for * each value a lod will be generated. <p> <strong>Important note :</strong> * some meshes cannot be decimated, so the result of this method can vary * depending of the given mesh. Also the reduction values are indicative and * the produces mesh will not always meet the required reduction. * * @param reductionMethod the reduction method to use * @param reductionValues the reduction value to use for each lod level. */ public void bakeLods(TriangleReductionMethod reductionMethod, float... reductionValues) { mesh.setLodLevels(computeLods(reductionMethod, reductionValues)); }
public void run() { for (final Geometry geometry : listGeoms) { LodGenerator lODGenerator = new LodGenerator(geometry); final VertexBuffer[] lods = lODGenerator.computeLods(method, value); enqueue(new Callable<Void>() { public Void call() throws Exception { geometry.getMesh().setLodLevels(lods); lodLevel = 0; if (geometry.getMesh().getNumLodLevels() > ll) { lodLevel = ll; } geometry.setLodLevel(lodLevel); hudText.setText(computeNbTri() + " tris"); return null; } }); } } });
/** * Computes the lods and bake them into the mesh<br> * * This method must be fed with the reduction method * {@link TriangleReductionMethod} and a list of reduction values.<br> for * each value a lod will be generated. <p> <strong>Important note :</strong> * some meshes cannot be decimated, so the result of this method can vary * depending of the given mesh. Also the reduction values are indicative and * the produces mesh will not always meet the required reduction. * * @param reductionMethod the reduction method to use * @param reductionValues the reduction value to use for each lod level. */ public void bakeLods(TriangleReductionMethod reductionMethod, float... reductionValues) { mesh.setLodLevels(computeLods(reductionMethod, reductionValues)); }