I'm converting over some of my old code to work with the newest version of jME and I have been struggling with some model loading code I wrote previously:
JmeBinaryReader jbr = new JmeBinaryReader();
jbr.setProperty("bound", "sphere");
node = new Node("Model");
jbr.loadBinaryFormat(node, model.openStream());
It used to work but now when it gets executed it an IOException is thrown:
java.io.IOException: Binary Header doesn't match. Maybe wrong file?
at com.jmex.model.XMLparser.JmeBinaryReader.readHeader(JmeBinaryReader.java:1272)
at com.jmex.model.XMLparser.JmeBinaryReader.loadBinaryFormat(JmeBinaryReader.java:156)
at com.captiveimagination.jme.LoadModel.simpleInitGame(LoadModel.java:55)
at com.jme.app.BaseSimpleGame.initGame(BaseSimpleGame.java:466)
at com.jme.app.BaseGame.start(BaseGame.java:56)
at com.captiveimagination.jme.LoadModel.main(LoadModel.java:29)
My assumption is that the changeover from JmeBinaryReader to BinaryImporter caused this problem. After switching my code to be:
BinaryImporter importer = new BinaryImporter();
node = (Node)importer.load(model);
node.setModelBound(new BoundingSphere());
Instead, it works fine again, but it makes me wonder what the purpose of JmeBinaryReader is anymore and if it shouldn't be deprecated or removed if it no longer works the same way as it used to?