com.jme3.scene.plugins.ogre.SceneMeshLoader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jme3-plugins Show documentation
Show all versions of jme3-plugins Show documentation
jMonkeyEngine is a 3-D game engine for adventurous Java developers
package com.jme3.scene.plugins.ogre;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import com.jme3.asset.AssetInfo;
import com.jme3.asset.AssetKey;
import com.jme3.scene.Spatial;
public class SceneMeshLoader extends MeshLoader{
private Map cache=new HashMap<>();
@Override
public Object load(AssetInfo info) throws IOException {
AssetKey key=info.getKey();
Spatial output=cache.get(key);
if(output==null){
output=(Spatial)super.load(info);
cache.put(key,output);
}
return output.clone(false);
}
public void reset(){
cache.clear();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy