// read in stuff ..
buff.position(header.getofsName());
modelname=new ZeroTerminatedString(buff);
/*
# 3 Skeleton and animation
* 3.1 Standard animation block
* 3.2 Global sequences
* 3.3 Animation sequences
* 3.4 Bones
# 4 Geometry and rendering
* 4.1 Vertices
* 4.2 Views (LOD)
o 4.2.1 Indices
o 4.2.2 Triangles
o 4.2.3 Vertex properties
o 4.2.4 Submeshes
o 4.2.5 Texture units
* 4.3 Render flags
* 4.4 Texture unit lookup table
* 4.5 Colors and transparency
o 4.5.1 Colors
o 4.5.2 Transparency lookup table
o 4.5.3 Transparency
* 4.6 Textures
o 4.6.1 Texture lookup table
o 4.6.2 Texture definitions
o 4.6.3 Texture animation lookup table
o 4.6.4 Texture animations
*/
anims=new AnimSequ[header.getNAnim()];
buff.position(header.getAnimoffs());
for(int i=0;i<header.getNAnim();i++){
anims[i]=new AnimSequ(buff);
}
System.out.println("Loaded AnimSequences\n");
nVertices= header.getnVertices();
ofsVertices= header.getofsVertices();
buff.position(ofsVertices);
vertex=new Vertex[nVertices];
for(int i=0;i<nVertices;i++){
vertex[i]=new Vertex(buff);
}
System.out.println("Loaded Vertices\n");
nBones= header.getnBones();
ofsBones= header.getofsBones();
buff.position(ofsBones);
bone=new Bones[nBones];
for(int i=0;i<nBones;i++){
bone[i]=new Bones(buff);
}
System.out.println("Loaded Bones\n");
buff.position(header.getofsBonelookup());
bonelookup=new short[header.getnBonelookup()];
for(int i=0;i<header.getnBonelookup();i++)
bonelookup[i]=buff.getShort();
keybonelookup=new short[header.getnKeyBoneLookup()];
buff.position(header.getofsKeyBoneLookup());
for(int i=0;i<header.getnKeyBoneLookup();i++){
keybonelookup[i]=buff.getShort();
}
texturelookup=new short[header.getnTexLookup()];
buff.position(header.getofsTexLookup());
for(int i=0;i<header.getnTexLookup();i++){
texturelookup[i]=buff.getShort();
}
texanimlookup=new short[header.getnTexAnimLookup()];
buff.position(header.getofsTexAnimLookup());
for(int i=0;i<header.getnTexAnimLookup();i++){
texanimlookup[i]=buff.getShort();
}
nTextures= header.getnTextures();
ofsTextures= header.getofsTextures();
buff.position(ofsTextures);
texdefs=new TexDef[nTextures];
texlength=new int[nTextures];
texoffs= new int[nTextures];
for(int i=0;i<nTextures;i++){
texdefs[i]=new TexDef(buff);
texlength[i]=texdefs[i].getlenFilename();
texoffs[i]=texdefs[i].getofsFilename();
}
textures= new ZeroTerminatedString[nTextures];
for(int i=0;i<nTextures;i++){
buff.position(0);
buff.position(texoffs[i]);
textures[i]=new ZeroTerminatedString(buff);
}
System.out.println("Loaded Textures\n");
texunits=new short[header.getnTexUnits()];