I have a problem here.I am trying to load a.md2 model first by using Loader.loadSerialize....() method.The size of .ser file is 363 kb.The original size of the .md2 file is 370kb.But at this time there is no error reported in the console and the model does not load or display in the screen or not getting any error on the console. So I decided to load the model using Loader.loadMd2() method. It loads all the animations and finally it says model loaded and followed by it throws this error.This error happens exactly at this line.
world.compileAllObjects(fb);
=========The method that loads the md2 model
So I removed all of the animations except one from it.But still I am getting the same error.
private Object3D drawCrabs(){
Object3D crab = null;
Resources res = getResources();
// try {
System.out.println("Start loading crab md2 model");
crab = Loader.loadMD2(res.openRawResource(R.raw.crab), 0.1f);
//crab = Loader.loadSerializedObject(new GZIPInputStream(res.openRawResource(R.raw.crabser)));
System.out.println("End loading crab md2 model");
// }
// catch (IOException ex) {
// java.util.logging.Logger.getLogger(GameActivity.class.getName()).log(Level.SEVERE, null, ex);
// }
//crab = Loader.loadSerializedObject(res.openRawResource(R.drawable.crabser));
// crab = Loader.loadMD2(getAssets().open("model/crabser.ser"), 1.0f);
// Bitmap image = BitmapFactory.decodeResource(res, R.drawable.crab1);
// Texture texture = new Texture(image);
// TextureManager.getInstance().addTexture("crabone", texture);
// crab.setTexture("crabone");
// removing some of the animation sequences from the model
int flip = crab.getAnimationSequence().getSequence("flip");
int salute = crab.getAnimationSequence().getSequence("salute");
int point = crab.getAnimationSequence().getSequence("point");
int attack = crab.getAnimationSequence().getSequence("attack");
int pain = crab.getAnimationSequence().getSequence("pain");
int jump = crab.getAnimationSequence().getSequence("jump");
int taunt = crab.getAnimationSequence().getSequence("taunt");
int wave = crab.getAnimationSequence().getSequence("wave");
int crstnd = crab.getAnimationSequence().getSequence("crstnd");
int crwalk = crab.getAnimationSequence().getSequence("crwalk");
int crattack = crab.getAnimationSequence().getSequence("crattack");
int crpain = crab.getAnimationSequence().getSequence("crpain");
int crdeath = crab.getAnimationSequence().getSequence("crdeath");
int death = crab.getAnimationSequence().getSequence("death");
crab.getAnimationSequence().remove(flip);
crab.getAnimationSequence().remove(salute);
crab.getAnimationSequence().remove(point);
crab.getAnimationSequence().remove(attack);
crab.getAnimationSequence().remove(pain);
crab.getAnimationSequence().remove(jump);
crab.getAnimationSequence().remove(taunt);
crab.getAnimationSequence().remove(wave);
crab.getAnimationSequence().remove(crstnd);
crab.getAnimationSequence().remove(crwalk);
crab.getAnimationSequence().remove(crattack);
crab.getAnimationSequence().remove(crpain);
crab.getAnimationSequence().remove(crdeath);
crab.getAnimationSequence().remove(death);
crab.compile();
// crab.strip();
crab.build();
System.out.println("....Returning from draw method...");
return crab;
}
I am using netbeans android emulator for development.