public boolean isLeaf() {
            return child[0] == null && child[1] == null;
        }
Creates one geometry out of the given root spatial and merges all single
textures into one texture of the given size.
@param spat The root spatial of the scene to batch
@param mgr An asset manager that can be used to create the material.
@param atlasSize A size for the atlas texture, it has to be large enough to hold all single textures.
@return A new geometry that uses the generated texture atlas and merges all meshes of the root spatial, null if the atlas cannot be created because not all textures fit.
jme3-core/src/tools/java/jme3tools/optimize/TextureAtlas.java