com.jlindamood.MS3D
Class MilkLoader

java.lang.Object
  extended bycom.sun.j3d.loaders.LoaderBase
      extended bycom.jlindamood.MS3D.MilkLoader
All Implemented Interfaces:
com.sun.j3d.loaders.Loader

public class MilkLoader
extends com.sun.j3d.loaders.LoaderBase

MilkLoader extends LoaderBase for a standard loader class to place Milkshape .ms3d files into Java3d Scene graphs. Loaded objects are returned as a SceneBase which users can pull animation objects from. If loading textures gives you problems, just set the base URL with .setBaseURL() to the texture base directory and try then.

Version:
1.0
Author:
Jack Lindamood
See Also:
SceneBase

Field Summary
 
Fields inherited from interface com.sun.j3d.loaders.Loader
LOAD_ALL, LOAD_BACKGROUND_NODES, LOAD_BEHAVIOR_NODES, LOAD_FOG_NODES, LOAD_LIGHT_NODES, LOAD_SOUND_NODES, LOAD_VIEW_GROUPS
 
Constructor Summary
MilkLoader()
           
 
Method Summary
 com.sun.j3d.loaders.Scene load(java.io.Reader reader)
          Deprecated. use load(String) load(URL)
 com.sun.j3d.loaders.Scene load(java.lang.String s)
          Loads a MilkShape file from the path in the string s.
 com.sun.j3d.loaders.Scene load(java.net.URL url)
          Loads a MilkShape file from the path in the URL.
 com.sun.j3d.loaders.SceneBase spawnFile()
          Produces a copy of the last file loaded.
 
Methods inherited from class com.sun.j3d.loaders.LoaderBase
getBasePath, getBaseUrl, getFlags, setBasePath, setBaseUrl, setFlags
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MilkLoader

public MilkLoader()
Method Detail

spawnFile

public com.sun.j3d.loaders.SceneBase spawnFile()
Produces a copy of the last file loaded. More efficient than reloaded a file because initial processing is completed and no file needs to be opened

Returns:
a new MilkScene by spawning the last loaded file, or null no preivous file was loaded
See Also:
Scene

load

public com.sun.j3d.loaders.Scene load(java.lang.String s)
                               throws java.io.FileNotFoundException,
                                      com.sun.j3d.loaders.IncorrectFormatException,
                                      com.sun.j3d.loaders.ParsingErrorException
Loads a MilkShape file from the path in the string s. All texture/alpha maps associated with the file are by default in the same directory as the .ms3d file specified. Texture directory can be changed by a call to setBasePath(String), allowing the programmer to seperate storage of model files and pictures.

Parameters:
s - Filename
Returns:
MilkScene loaded from the file
Throws:
java.io.FileNotFoundException - Either .ms3d file or texture files don't exist
com.sun.j3d.loaders.IncorrectFormatException - File doesn't check with MS3D header
com.sun.j3d.loaders.ParsingErrorException - Some type of error while reading in file information
See Also:
Scene

load

public com.sun.j3d.loaders.Scene load(java.net.URL url)
                               throws java.io.FileNotFoundException,
                                      com.sun.j3d.loaders.IncorrectFormatException,
                                      com.sun.j3d.loaders.ParsingErrorException
Loads a MilkShape file from the path in the URL. All texture/alpha maps associated with the URL are by default in the same directory as the .ms3d file specified. Texture directory can be changed by a call to setBaseURL(URL), allowing the programmer to seperate storage of model files and pictures.

Parameters:
url - Location of .ms3d file
Returns:
MilkScene loaded from the file
Throws:
java.io.FileNotFoundException - Either .ms3d file or texture files don't exist
com.sun.j3d.loaders.IncorrectFormatException - File doesn't check with MS3D header
com.sun.j3d.loaders.ParsingErrorException - Some type of error while reading in file information
See Also:
Scene

load

public com.sun.j3d.loaders.Scene load(java.io.Reader reader)
                               throws java.io.FileNotFoundException,
                                      com.sun.j3d.loaders.IncorrectFormatException,
                                      com.sun.j3d.loaders.ParsingErrorException
Deprecated. use load(String) load(URL)

Unsupported loading from a Reader. Allways throws ParsingErrorException

Parameters:
reader - Unused
Returns:
never reached
Throws:
java.io.FileNotFoundException - For compatability w/ interface Loader
com.sun.j3d.loaders.IncorrectFormatException - For compatability w/ interface Loader
com.sun.j3d.loaders.ParsingErrorException - Allways thrown