md3.md3view
Class MD3GLModelFactory

java.lang.Object
  |
  +--md3.md3model.MD3ModelFactory
        |
        +--md3.md3view.MD3GLModelFactory

public class MD3GLModelFactory
extends MD3ModelFactory

An MD3Model factory that creates OpenGL compatible MD3 model objects, instead of the default ones. The class itself has a static texture resource manager that will cache read texture data.

Author:
Erwin Vervaet (erwin@cs.kuleuven.ac.be)

Constructor Summary
MD3GLModelFactory()
           
 
Method Summary
 MD3Mesh makeMD3Mesh(java.io.DataInput din)
          Create a new MD3Mesh object and initialize it with data read from the specified input stream.
 MD3Model makeMD3Model(java.lang.String name, java.io.InputStream in)
          Factory method that loads an MD3 model from a specified input stream and sets up an MD3Model object with the read information.
 MD3Texture makeMD3Texture(java.lang.String name, java.lang.String loadFilename)
          Factory method that loads a texture and enters it in the texture resource manager.
 MD3Texture makeMD3Texture(java.lang.String name, java.lang.String loadFilename, java.io.InputStream in)
          Loads a texture from the given input stream and enters it in the resource manager.
static void refreshTexture(java.lang.String loadFilename)
          Reloads cached texture data from source for given texture, if present in cache.
 
Methods inherited from class md3.md3model.MD3ModelFactory
getFactory, makeAnimationCfg, makeAnimationCfg, makeAnimationCfg, makeMD3Animation, makeMD3Animation, makeMD3BoneFrame, makeMD3BoneFrame, makeMD3Mesh, makeMD3Model, makeMD3Model, makeMD3Skin, makeMD3Skin, makeMD3Skin, makeMD3Tag, makeMD3Tag, makeMD3Texture, setFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MD3GLModelFactory

public MD3GLModelFactory()
Method Detail

makeMD3Model

public MD3Model makeMD3Model(java.lang.String name,
                             java.io.InputStream in)
                      throws java.io.IOException
Description copied from class: MD3ModelFactory

Factory method that loads an MD3 model from a specified input stream and sets up an MD3Model object with the read information. The given name will be stored as the model's loadFilename.

Overrides:
makeMD3Model in class MD3ModelFactory
Tags copied from class: MD3ModelFactory
Parameters:
name - Name of the model.
in - Stream to read data from.
Returns:
An MD3Model object containing the read information.

makeMD3Mesh

public MD3Mesh makeMD3Mesh(java.io.DataInput din)
                    throws java.io.IOException
Description copied from class: MD3ModelFactory

Create a new MD3Mesh object and initialize it with data read from the specified input stream.

Overrides:
makeMD3Mesh in class MD3ModelFactory

makeMD3Texture

public MD3Texture makeMD3Texture(java.lang.String name,
                                 java.lang.String loadFilename)

Factory method that loads a texture and enters it in the texture resource manager.

It will use the searchForPath() method of MD3View to resolve the loadFilename, so the texture might be loaded from any data source the MD3View instance has.

Overrides:
makeMD3Texture in class MD3ModelFactory
Parameters:
name - Name of the texture as specified in .md3 or .skin file.
loadFilename - Full name of file from which texture data will be loaded.
Returns:
The loaded MD3GLTexture object or null if there was a problem while loading the texture.

makeMD3Texture

public MD3Texture makeMD3Texture(java.lang.String name,
                                 java.lang.String loadFilename,
                                 java.io.InputStream in)

Loads a texture from the given input stream and enters it in the resource manager.

Overrides:
makeMD3Texture in class MD3ModelFactory
Tags copied from class: MD3ModelFactory
Parameters:
name - Name of the texture as specified in .md3 or .skin file.
loadFilename - Full name of file from which texture is (supposedly) loaded.
in - Stream to load texture data from.
Returns:
The loaded MD3Texture object;

refreshTexture

public static void refreshTexture(java.lang.String loadFilename)

Reloads cached texture data from source for given texture, if present in cache.