Hey,
I had a working program that could import a .jme model into StandardGame. However, I decided to update to jME 2.0.
After fixing all the broken code, I ran the program and this is what i got:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 16
at com.jme.scene.Spatial.read(Spatial.java:1073)
at com.jme.scene.Geometry.read(Geometry.java:874)
at com.jme.scene.TriMesh.read(TriMesh.java:628)
at com.jme.util.export.binary.BinaryImporter.readObject(BinaryImporter.java:256)
at com.jme.util.export.binary.BinaryInputCapsule.resolveIDs(BinaryInputCapsule.java:472)
at com.jme.util.export.binary.BinaryInputCapsule.readSavableArray(BinaryInputCapsule.java:460)
at com.jme.util.export.binary.BinaryInputCapsule.readSavableArrayList(BinaryInputCapsule.java:564)
at com.jme.scene.Node.read(Node.java:679)
at com.jme.util.export.binary.BinaryImporter.readObject(BinaryImporter.java:256)
at com.jme.util.export.binary.BinaryImporter.load(BinaryImporter.java:164)
at com.jme.util.export.binary.BinaryImporter.load(BinaryImporter.java:86)
at jmectftest.jmectfGameState.buildPlayer(jmectfGameState.java:185)
at jmectftest.jmectfGameState.<init>(jmectfGameState.java:126)
at jmectftest.jmectfTest.start(jmectfTest.java:25)
at jmectftest.jmectfTest.main(jmectfTest.java:17)
the code worked before:
Spatial model = null;
try {
File file = new File("data/tank.jme");
URL path = file.toURI().toURL();
BinaryImporter importer = new BinaryImporter();
model = (Spatial)importer.load(path.openStream());
model.setModelBound(new BoundingBox());
model.updateModelBound();
model.setLocalScale(2.0f);
model.rotateUpTo(new Vector3f(0.0f, 0.0f, -1.0f));
model.rotateUpTo(new Vector3f(.5f , 0.0f, 0.0f));
} catch (IOException e) {
System.out.println("Could not load model.");
System.exit(1);
}