Blender jme newbie question

hi… i think this should be addressed to me blaine… sir, I'm trying to understand the XmlWorld.java that is included on the hottbj tutorial…


import java.util.List;
import java.util.ArrayList;
import java.net.URL;
import java.net.MalformedURLException;
 
import com.jme.input.MouseInput;
import com.jme.input.FirstPersonHandler;
import com.jme.util.export.xml.XMLImporter;
import com.jme.bounding.BoundingBox;
import com.jme.scene.Spatial;
import com.jme.app.SimpleGame;
 
public class XmlWorld extends SimpleGame {
    private URL[] modelUrls;
    protected XMLImporter xmlImporter = XMLImporter.getInstance();
 
    static public void main(String[] args) throws MalformedURLException {
        XmlWorld.parseAndRun(new XmlWorld(), args);
    }
 
    static protected void parseAndRun(XmlWorld xmlWorld, String[] args)
            throws MalformedURLException {
        int counter = -1;
        List<URL> urls = new ArrayList<URL>();
        for (String urlString : args) {
            if (urlString.equals("-r")) {
                xmlWorld.setConfigShowMode(ConfigShowMode.AlwaysShow);
            } else {
                urls.add(new URL(urlString));
            }
        }
        xmlWorld.setModelUrls(urls.toArray(new URL[0]));
        xmlWorld.start();
    }
 
    public void setModelUrls(URL[] modelUrls) {
        this.modelUrls = modelUrls;
    }
 
    protected void simpleInitGame() {
       MouseInput.get().setCursorVisible(true);
        try {
            MouseInput.get().setCursorVisible(true);
            ((FirstPersonHandler) input).setButtonPressRequired(true);
            // Windowed mode is extremely irritating without these two settings.
 
            if (modelUrls == null)
                throw new IllegalStateException(XmlWorld.class.getName()
                        + " not initialized properly");
            for (URL url : modelUrls) loadModel(url);
        } catch (Exception e) {
            // Programs should not just continue obvliviously when exceptions
            // are thrown.  Since we aren't handling them, we exit gracefully.
            e.printStackTrace();
            finish();
        }
    }
 
    protected void loadModel(URL modelUrl) {
        // May also be called during update() loop to add to scene.
        Spatial loadedSpatial = null;
        try {
            loadedSpatial = (Spatial) xmlImporter.load(modelUrl);
        } catch (Exception e) {
            throw new IllegalArgumentException(
                    "Failed to load URL: " + modelUrl, e);
        }
        loadedSpatial.setModelBound(new BoundingBox());
        rootNode.attachChild(loadedSpatial);
        loadedSpatial.updateModelBound();
        // The default update loop will update world bounding volumes.
        rootNode.updateRenderState();
    }
}



it seems I couldn't find where I would put the url...

XmlWorld.class.getResource("models/try-jme.xml");

sorry for being such a noob

bump

In that example, you're supposed to supply the url as an argument on the command line. If you'd like to use it in an app of your own, it's the loadModel() method you want. Without double checking, I think XMLAnimator (if that's what it's called) was more suitable for that purpose.