com.jmex.model.converters
Class Md2ToJme

java.lang.Object
  extended by com.jmex.model.converters.FormatConverter
      extended by com.jmex.model.converters.Md2ToJme

public class Md2ToJme
extends FormatConverter

Started Date: Jun 14, 2004

This class converts a .md2 file to jME's binary format.

Author:
Jack Lindamood

Field Summary
 
Fields inherited from class com.jmex.model.converters.FormatConverter
properties
 
Constructor Summary
Md2ToJme()
           
 
Method Summary
 void convert(java.io.InputStream Md2Stream, java.io.OutputStream o)
          It creates a node from a .md2 stream and then writes that node to the given OutputStream in jME's binary format.
static KeyframeController findController(Node model)
          This function returns the KeyframeController that animates an MD2 converted mesh.
static void main(java.lang.String[] args)
          Converts an Md2 file to jME format.
 
Methods inherited from class com.jmex.model.converters.FormatConverter
attemptFileConvert, clearProperty, getProperty, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Md2ToJme

public Md2ToJme()
Method Detail

main

public static void main(java.lang.String[] args)
Converts an Md2 file to jME format. The syntax is: "Md2ToJme drfreak.md2 outfile.jme".

Parameters:
args - The array of parameters

convert

public void convert(java.io.InputStream Md2Stream,
                    java.io.OutputStream o)
             throws java.io.IOException
It creates a node from a .md2 stream and then writes that node to the given OutputStream in jME's binary format.

Specified by:
convert in class FormatConverter
Parameters:
Md2Stream - A stream representing the .md2 file
o - The stream to write it's binary equivalent to
Throws:
java.io.IOException - If anything funky goes wrong with reading information

findController

public static KeyframeController findController(Node model)
This function returns the KeyframeController that animates an MD2 converted mesh. Null is returned if a KeyframeController cannot be found.

Parameters:
model - The MD2 mesh.
Returns:
This mesh's controller.