md3.md3model
Class MD3Texture

java.lang.Object
  |
  +--md3.md3model.MD3Texture
Direct Known Subclasses:
MD3GLTexture

public class MD3Texture
extends java.lang.Object
implements java.io.Serializable

Objets of this class represent textures with associated metadata. The texture data is stored in the OpenGL compatible RGBA format.

Author:
Erwin Vervaet (erwin@cs.kuleuven.ac.be)
See Also:
Serialized Form

Field Summary
 byte[] data
          Actual texture bitmap data.
 int height
           
 java.lang.String loadFilename
          Filename of actual file from which data was loaded.
 java.lang.String name
          Name as specified in the originating .md3 model or .skin file.
 int width
           
 
Constructor Summary
protected MD3Texture()
          Create a new uninitialized MD3Texture object.
protected MD3Texture(java.lang.String name, java.lang.String loadFilename)
          Constructor for use in subclasses that loads texture data from the specified file and initializes a new MD3Texture object with the read data/metadata.
protected MD3Texture(java.lang.String name, java.lang.String loadFilename, java.io.InputStream in)
          Constructor for use in subclasses that loads texture data from the sepcified input stream and initializes a new MD3Texture object with the read data/metadata.
 
Method Summary
protected  void getTextureData(java.io.InputStream in)
          Load the texture data from the given input stream and put it in the data array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public java.lang.String name

Name as specified in the originating .md3 model or .skin file.


loadFilename

public java.lang.String loadFilename

Filename of actual file from which data was loaded.


data

public byte[] data

Actual texture bitmap data. These are unsigned bytes in RGBA order.


width

public int width

height

public int height
Constructor Detail

MD3Texture

protected MD3Texture(java.lang.String name,
                     java.lang.String loadFilename)
              throws java.io.IOException

Constructor for use in subclasses that loads texture data from the specified file and initializes a new MD3Texture object with the read data/metadata.

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.

MD3Texture

protected MD3Texture(java.lang.String name,
                     java.lang.String loadFilename,
                     java.io.InputStream in)
              throws java.io.IOException

Constructor for use in subclasses that loads texture data from the sepcified input stream and initializes a new MD3Texture object with the read data/metadata. The given loadFilename is stored in the corresponding data member.

Parameters:
name - Name of the texture as specified in .md3 or .skin file.
loadFilename - Full name of file from which texture data is (supposedly) loaded.
in - Stream from to load texture data from.

MD3Texture

protected MD3Texture()

Create a new uninitialized MD3Texture object.

Method Detail

getTextureData

protected void getTextureData(java.io.InputStream in)
                       throws java.io.IOException

Load the texture data from the given input stream and put it in the data array.

TGA or JPG input is selected depending on the loadFilename, so make sure it is set before calling this method!