com.md5importer
Class MD5Importer

java.lang.Object
  extended by com.md5importer.MD5Importer

public class MD5Importer
extends java.lang.Object

MD5Importer defines a utility unit that contains the logic of importing a MD5 formated skeletal animated model.

MD5Importer does not provide any thread safety. It can be reused to repeatedly to import model files. However, it requires external invocation to perform clean up before next reuse.

For details on MD5 format, please go to official MD5 wiki at http://www.modwiki.net/wiki/MD5_(file_format).


Constructor Summary
MD5Importer()
          Constructor of MD5Importer.
 
Method Summary
 void cleanup()
          Cleanup the importer.
 int getAnisotropic()
          Retrieve the anisotropic level.
 com.jme.image.Texture.MagnificationFilter getMagFilter()
          Retrieve the magnification (FM) texture filter.
 com.jme.image.Texture.MinificationFilter getMiniFilter()
          Retrieve the minification (MM) texture filter.
 boolean isOriented()
          Check if oriented bounding should be used.
 IMD5Anim loadAnim(java.net.URL md5anim, java.lang.String name)
          Load the given md5anim file.
 IMD5Node loadMesh(java.net.URL md5mesh, java.lang.String name)
          Load the given md5mesh file.
 void setAnisotropic(int aniso)
          Set the texture anisotropic level.
 void setMagFilter(com.jme.image.Texture.MagnificationFilter filter)
          Set the magnification (FM) Texture filter.
 void setMiniFilter(com.jme.image.Texture.MinificationFilter filter)
          Set the minification (MM) Texture filter.
 void setOrientedBounding(boolean value)
          Set if oriented bounding should be used for the meshes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MD5Importer

public MD5Importer()
Constructor of MD5Importer.

Method Detail

loadMesh

public IMD5Node loadMesh(java.net.URL md5mesh,
                         java.lang.String name)
                  throws java.io.IOException
Load the given md5mesh file.

Parameters:
md5mesh - The URL points to the md5mesh file.
name - The String name of the loaded model.
Returns:
The loaded IMD5Node instance.
Throws:
java.io.IOException - Thrown when errors occurred during file reading.

loadAnim

public IMD5Anim loadAnim(java.net.URL md5anim,
                         java.lang.String name)
                  throws java.io.IOException
Load the given md5anim file.

Parameters:
md5anim - The URL points to the md5anim file.
name - The String name of the loaded animation.
Returns:
The loaded IMD5Anim instance.
Throws:
java.io.IOException - Thrown when errors occurred during file reading.

setMiniFilter

public void setMiniFilter(com.jme.image.Texture.MinificationFilter filter)
Set the minification (MM) Texture filter.

Parameters:
filter - The minification (MM) Texture filter.

setMagFilter

public void setMagFilter(com.jme.image.Texture.MagnificationFilter filter)
Set the magnification (FM) Texture filter.

Parameters:
filter - The magnification (FM) Texture filter.

setAnisotropic

public void setAnisotropic(int aniso)
Set the texture anisotropic level.

Parameters:
aniso - The Integer anisotropic level value.

setOrientedBounding

public void setOrientedBounding(boolean value)
Set if oriented bounding should be used for the meshes.

Parameters:
value - The Boolean oriented bounding flag.

getMiniFilter

public com.jme.image.Texture.MinificationFilter getMiniFilter()
Retrieve the minification (MM) texture filter.

Returns:
The MinificationFilter enumeration.

getMagFilter

public com.jme.image.Texture.MagnificationFilter getMagFilter()
Retrieve the magnification (FM) texture filter.

Returns:
The MagnificationFilter enumeration.

getAnisotropic

public int getAnisotropic()
Retrieve the anisotropic level.

Returns:
The Integer anisotropic level.

isOriented

public boolean isOriented()
Check if oriented bounding should be used.

Returns:
The Boolean oriented bounding flag.

cleanup

public void cleanup()
Cleanup the importer.