com.jmex.model.ogrexml
Class MaterialLoader

java.lang.Object
  extended by com.jmex.model.ogrexml.MaterialLoader

public class MaterialLoader
extends java.lang.Object

Reads OGRE3D material files
MaterialLoader.getMaterials() to get a map of materials. call Material.apply(Spatial) to apply material to a model.


Constructor Summary
MaterialLoader()
           
 
Method Summary
 java.util.Map<java.lang.String,Material> getMaterials()
           
 void load(java.io.InputStream in)
          REPLACE the materialsMap of this MaterialLoader instance.
 void load(java.net.URI uri)
          Convenience wrapper.
 void load(java.net.URL url)
          REPLACE the materialsMap of this MaterialLoader instance, automatically adding the containing directory to the resource locator paths for the duration of the load.
 double nextNumber()
           
 java.lang.String nextStatement()
           
 java.lang.String nextStatementRightCurlyNull()
           
 void println(java.lang.String str)
          Deprecated. If you want to see debugging messages, you should use the logging infrastructure which is there for this purpose. This allows you to specify when to see messages declaratively, without changing any source code.
 ColorRGBA readColor()
           
 float[] readFloatArray()
          Deprecated. Haven't checked the history, but this method is now a no-op.
 Material readMaterial()
           
 void readMaterialStatement(Material material)
           
 void readPass(Material material)
           
 void readPassStatement(Material material)
           
 void readTechnique(Material material)
           
 void readTechniqueStatement(Material material)
           
 void readTextureUnit(Material material)
           
 void readUnitStatement(TextureState tex, int unit)
           
 void setupReader(java.io.StreamTokenizer reader)
           
 java.lang.String tokenName()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MaterialLoader

public MaterialLoader()
Method Detail

getMaterials

public java.util.Map<java.lang.String,Material> getMaterials()

tokenName

public java.lang.String tokenName()

nextStatementRightCurlyNull

public java.lang.String nextStatementRightCurlyNull()
                                             throws java.io.IOException
Throws:
java.io.IOException

nextStatement

public java.lang.String nextStatement()
                               throws java.io.IOException
Throws:
java.io.IOException

nextNumber

public double nextNumber()
                  throws java.io.IOException
Throws:
java.io.IOException

readColor

public ColorRGBA readColor()
                    throws java.io.IOException
Throws:
java.io.IOException

readFloatArray

@Deprecated
public float[] readFloatArray()
Deprecated. Haven't checked the history, but this method is now a no-op.

This method just returns null.


readMaterialStatement

public void readMaterialStatement(Material material)
                           throws java.io.IOException
Throws:
java.io.IOException

readTechniqueStatement

public void readTechniqueStatement(Material material)
                            throws java.io.IOException
Throws:
java.io.IOException

readUnitStatement

public void readUnitStatement(TextureState tex,
                              int unit)
                       throws java.io.IOException
Throws:
java.io.IOException

readTextureUnit

public void readTextureUnit(Material material)
                     throws java.io.IOException
Throws:
java.io.IOException

readPassStatement

public void readPassStatement(Material material)
                       throws java.io.IOException
Throws:
java.io.IOException

readPass

public void readPass(Material material)
              throws java.io.IOException
Throws:
java.io.IOException

readTechnique

public void readTechnique(Material material)
                   throws java.io.IOException
Throws:
java.io.IOException

readMaterial

public Material readMaterial()
                      throws java.io.IOException
Throws:
java.io.IOException

setupReader

public void setupReader(java.io.StreamTokenizer reader)

load

public void load(java.io.InputStream in)
          throws java.io.IOException
REPLACE the materialsMap of this MaterialLoader instance.

Throws:
java.io.IOException

println

@Deprecated
public void println(java.lang.String str)
Deprecated. If you want to see debugging messages, you should use the logging infrastructure which is there for this purpose. This allows you to specify when to see messages declaratively, without changing any source code.

Print a debugging message to standard output.


load

public void load(java.net.URI uri)
          throws java.io.IOException
Convenience wrapper.

Throws:
java.io.IOException
See Also:
load(URL)

load

public void load(java.net.URL url)
          throws java.io.IOException
REPLACE the materialsMap of this MaterialLoader instance, automatically adding the containing directory to the resource locator paths for the duration of the load. The materials may then be retrieved with getMaterials().

An example of invoking this method for a filesystem file:

  materialLoader.load(file.toURI());
  

Throws:
java.io.IOException
See Also:
getMaterials(), RelativeResourceLocator