private void build() {
        BoundingSphere bs = new BoundingSphere();
        bs.computeFromPoints(mesh.getFloatBuffer(VertexBuffer.Type.Position));
        meshBoundingSphereRadius = bs.getRadius();
        List<Vertex> vertexLookup = new ArrayList<>();
        initialize();
        
        gatherVertexData(mesh, vertexLookup);
        gatherIndexData(mesh, vertexLookup);
        computeCosts();
       // assert (assertValidMesh());
        
    }
Constructs an LodGenerator for the given Geometry.

@param geom the geometry for which to generate LODs.
jme3-core/src/tools/java/jme3tools/optimize/LodGenerator.java