com.jmex.model.converters
Class MilkToJme

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

public class MilkToJme
extends FormatConverter

Started Date: Jun 8, 2004

This class converts a .ms3d file to jME's binary format. The way it converts is by first building the .ms3d scenegraph object, then saving that object to binary format via com.jmex.model.XMLparser.JmeBinaryWriter. This requires a DisplaySystem to function correctly (as all loaders do).

This will normally be provided within a game environment (such as SimpleGame). However if you wish to use this in a stand-alone environment, such as part of a tool conversion utility, you should create a DummyDisplaySystem before using this class.

Author:
Jack Lindamood

Field Summary
 
Fields inherited from class com.jmex.model.converters.FormatConverter
properties
 
Constructor Summary
MilkToJme()
           
 
Method Summary
 void convert(java.io.InputStream MSFile, java.io.OutputStream o)
          This class's only public function.
static JointController findController(Node model)
          This function returns the controller of a loaded Milkshape3D model.
static void main(java.lang.String[] args)
          Converts a MS3D 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

MilkToJme

public MilkToJme()
Method Detail

main

public static void main(java.lang.String[] args)
Converts a MS3D file to jME format. The syntax is: "MilkToJme runner.ms3d out.jme".

Parameters:
args - The array of parameters

convert

public void convert(java.io.InputStream MSFile,
                    java.io.OutputStream o)
             throws java.io.IOException
This class's only public function. It creates a node from a .ms3d stream and then writes that node to the given OutputStream in binary format

Specified by:
convert in class FormatConverter
Parameters:
MSFile - An inputStream that is the .ms3d file
o - The Stream to write it's jME binary equivalent to
Throws:
java.io.IOException - If anything funky goes wrong with reading information

findController

public static JointController findController(Node model)
This function returns the controller of a loaded Milkshape3D model. Will return null if a correct JointController could not be found, or if one does not exist.

Parameters:
model - The model that was loaded.
Returns:
The controller for that milkshape model.