|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--md3.md3model.MD3Model
The MD3Model class contains data structures to hold all information contained in an MD3 model file.
MD3Model really is a 1 class composite pattern: you can link models to a model and iterate over the linked models. Normally you link an object to an MD3Model if that object represents a submodel of the model at a certain tag position.
MD3Model objects support visitor objects to do certain operations on/with the information contained in an MD3Model.
MD3Tag
,
MD3ModelVisitor
, Serialized FormField Summary | |
int |
boneFrameNum
Number of animation key frames in the model. |
MD3BoneFrame[] |
boneFrames
Array of bone frames size boneFrameNum. |
int |
boneFrameStart
Starting position of bone frame data structures. |
java.lang.String |
filename
Filename as recorded in the .md3 file. |
int |
fileSize
|
java.lang.String |
id
|
protected java.util.SortedMap |
linkedModels
Map used to store the models linked to this model. |
java.lang.String |
loadFilename
Filename of actual file from which data was loaded. |
int |
maxTextureNum
Maximum number of unique textures used in an md3 file. |
MD3Mesh[] |
meshes
Array of meshes in the model size meshNum. |
int |
meshNum
|
int |
meshStart
Starting position of mesh structures. |
int |
tagNum
|
int |
tagStart
Starting position of tag-structures. |
int |
version
|
Constructor Summary | |
protected |
MD3Model()
Constructor for use in subclasses that creates a new, uninitialized MD3Model object. |
protected |
MD3Model(java.lang.String filename)
Constructor for use in subclasses that reads an MD3 model from a file. |
protected |
MD3Model(java.lang.String loadFilename,
java.io.InputStream in)
Constructor for use in subclasses that reads an MD3 model from the specified input stream. |
Method Summary | |
void |
accept(MD3ModelVisitor v)
MD3Model objects can be visited, according to the visitor pattern, by MD3ModelVistor objects. |
void |
addLinkedModel(int tagIndex,
MD3Model child)
Link a model at the specified tag position to this model. |
boolean |
animated()
Return wether or not this model contains animation data. |
MD3Model |
getParent()
Return the parent model of this model, or null if none. |
int |
getParentTagIndex()
Return the index of the tag this model is linked to in it's parent's tags array. |
int |
getTagIndexByName(java.lang.String tagName)
Return the index of the tag with the given name for this model. |
java.util.Iterator |
linkedModels()
Request an iterator to step through all models linked to this model. |
void |
removeLinkedModel(int tagIndex)
Remove the model linked to this model at the specified tag position. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public java.lang.String id
public int version
public java.lang.String filename
Filename as recorded in the .md3 file. This might be empty.
public java.lang.String loadFilename
Filename of actual file from which data was loaded.
public int boneFrameNum
Number of animation key frames in the model.
public int tagNum
public int meshNum
public int maxTextureNum
Maximum number of unique textures used in an md3 file.
public int boneFrameStart
Starting position of bone frame data structures.
public int tagStart
Starting position of tag-structures.
public int meshStart
Starting position of mesh structures.
public int fileSize
public MD3BoneFrame[] boneFrames
Array of bone frames size boneFrameNum. The contains the metadata (bounding box, tags, ..,) for each of the bone animation frames in the model.
public MD3Mesh[] meshes
Array of meshes in the model size meshNum. Each mesh contains the data of that mesh for each of the animation frames in the model.
protected java.util.SortedMap linkedModels
Map used to store the models linked to this model. The map is indexed by tag index number and also ordered by index number.
Constructor Detail |
protected MD3Model(java.lang.String filename) throws java.io.IOException
Constructor for use in subclasses that reads an MD3 model from a file.
protected MD3Model(java.lang.String loadFilename, java.io.InputStream in) throws java.io.IOException
Constructor for use in subclasses that reads an MD3 model from the specified input stream. The given loadFilename is stored in the corresponding data member.
protected MD3Model()
Constructor for use in subclasses that creates a new, uninitialized MD3Model object.
Method Detail |
public void addLinkedModel(int tagIndex, MD3Model child)
Link a model at the specified tag position to this model. If the position is allready occupied, the old submodel will be replaced.
tagIndex
- Tag to link the submodel to.child
- The submodel that should be linked to this model.public void removeLinkedModel(int tagIndex)
Remove the model linked to this model at the specified tag position.
public java.util.Iterator linkedModels()
Request an iterator to step through all models linked to this model.
public int getParentTagIndex()
Return the index of the tag this model is linked to in it's parent's tags array. This can be used to figure out the position of this model relative to that of it's parent.
This will return -1 if there is no parent model.
public int getTagIndexByName(java.lang.String tagName)
Return the index of the tag with the given name for this model.
This will return -1 if their is no such tag.
public MD3Model getParent()
Return the parent model of this model, or null if none.
public void accept(MD3ModelVisitor v)
MD3Model objects can be visited, according to the visitor pattern, by MD3ModelVistor objects.
v
- The visitor.public boolean animated()
Return wether or not this model contains animation data.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |