|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xith3d.loaders.models.ModelLoader
public class ModelLoader
The abstract Loader class is used to specify the location and elements of a file format to load. The class is used to give loaders of various file formats a common public interface. Ideally the Scene and Model classes will be extended to give the user a consistent interface to extract the data.
org.xith3d.loaders.models.base.LoadedGraph,
org.xith3d.loaders.models.base.Scene,
Model| Nested Class Summary | |
|---|---|
protected static class |
ModelLoader.SourceModelType
|
protected static class |
ModelLoader.SpecialItemsHandlerImpl
|
| Field Summary | |
|---|---|
static int |
ALWAYS_CONVERT_Z_UP_TO_Y_UP
This flag forces the conversion from Z-up to Y-up for all model types. |
static int |
CONVERT_Z_UP_TO_Y_UP_IF_EXPECTED
This flag makes the loader to convert the model from z-up to y-up if the source model format is known to use z-up by default (like 3DS, MD2, MD3, MD5 and BSP). |
static int |
DEFAULT_FLAGS
|
static int |
LOAD_CAMERAS
This flag enables the loading of camera (view) objects into the scene. |
static int |
LOAD_FOG_NODES
This flag enables the loading of fog objects into the scene. |
static int |
LOAD_LIGHT_NODES
This flag enables the loading of light objects into the scene. |
static int |
LOAD_SOUND_NODES
This flag enables the loading of sound objects into the scene. |
static int |
LOAD_SUB_MODELS
This flag enables the loading of camera (view) objects into the scene. |
static float |
SCALE
|
| Constructor Summary | |
|---|---|
protected |
ModelLoader()
Constructs a ModelLoader with default flags. |
protected |
ModelLoader(int flags)
Constructs a ModelLoader with the specified flags word. |
| Method Summary | |
|---|---|
protected ModelLoader.SourceModelType |
extractModelType(java.lang.String filename)
|
protected ModelLoader.SourceModelType |
extractModelType(java.net.URL url)
|
protected ModelLoader.SourceModelType |
extractModelType(java.net.URL url,
java.lang.String filename)
|
boolean |
getFlag(int flag)
|
int |
getFlags()
|
static ModelLoader |
getInstance()
If you decide to use the Loader as a singleton, here is the method to get the instance from. |
Model |
loadModel(java.lang.String filename)
This method loads the Model from a URL. |
Model |
loadModel(java.lang.String filename,
float scale)
This method loads the Model from a URL. |
Model |
loadModel(java.lang.String filename,
float scale,
int flags)
This method loads the Model from a URL. |
Model |
loadModel(java.lang.String filename,
java.lang.String skin)
This method loads the Model from a URL. |
Model |
loadModel(java.lang.String filename,
java.lang.String skin,
float scale)
This method loads the Model from a URL. |
Model |
loadModel(java.lang.String filename,
java.lang.String skin,
float scale,
int flags)
This method loads the Model from a URL. |
Model |
loadModel(java.net.URL url)
This method loads the Model from a URL. |
Model |
loadModel(java.net.URL url,
float scale)
This method loads the Model from a URL. |
Model |
loadModel(java.net.URL url,
float scale,
int flags)
This method loads the Model from a URL. |
Model |
loadModel(java.net.URL url,
java.lang.String skin)
This method loads the Model from a URL. |
Model |
loadModel(java.net.URL url,
java.lang.String skin,
float scale)
This method loads the Model from a URL. |
Model |
loadModel(java.net.URL url,
java.lang.String skin,
float scale,
int flags)
This method loads the Model from a URL. |
protected Model |
loadModel(java.net.URL url,
java.lang.String filenameBase,
ModelLoader.SourceModelType modelType,
java.net.URL baseURL,
java.lang.String skin,
float scale,
int flags,
org.jagatoo.loaders.models._util.AppearanceFactory appFactory,
org.jagatoo.loaders.models._util.GeometryFactory geomFactory,
org.jagatoo.loaders.models._util.NodeFactory nodeFactory,
org.jagatoo.loaders.models._util.AnimationFactory animFactory,
org.jagatoo.loaders.models._util.SpecialItemsHandler siHandler,
Model model)
|
Model |
loadModel(java.net.URL url,
java.lang.String filenameBase,
java.net.URL baseURL,
java.lang.String skin,
float scale,
int flags)
|
void |
setFlag(int flag,
boolean enable)
This method sets the specified load flag for the file. |
void |
setFlags(int flags)
This method sets the load flags for the file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final float SCALE
public static final int LOAD_LIGHT_NODES
public static final int LOAD_FOG_NODES
public static final int LOAD_SOUND_NODES
public static final int LOAD_CAMERAS
public static final int LOAD_SUB_MODELS
public static final int CONVERT_Z_UP_TO_Y_UP_IF_EXPECTED
public static final int ALWAYS_CONVERT_Z_UP_TO_Y_UP
public static final int DEFAULT_FLAGS
| Constructor Detail |
|---|
protected ModelLoader(int flags)
flags - protected ModelLoader()
| Method Detail |
|---|
public final void setFlags(int flags)
public final int getFlags()
public final void setFlag(int flag,
boolean enable)
flag - the flag to set/resetenable - true to enable the flagpublic final boolean getFlag(int flag)
protected ModelLoader.SourceModelType extractModelType(java.net.URL url,
java.lang.String filename)
protected final ModelLoader.SourceModelType extractModelType(java.net.URL url)
protected final ModelLoader.SourceModelType extractModelType(java.lang.String filename)
protected Model loadModel(java.net.URL url,
java.lang.String filenameBase,
ModelLoader.SourceModelType modelType,
java.net.URL baseURL,
java.lang.String skin,
float scale,
int flags,
org.jagatoo.loaders.models._util.AppearanceFactory appFactory,
org.jagatoo.loaders.models._util.GeometryFactory geomFactory,
org.jagatoo.loaders.models._util.NodeFactory nodeFactory,
org.jagatoo.loaders.models._util.AnimationFactory animFactory,
org.jagatoo.loaders.models._util.SpecialItemsHandler siHandler,
Model model)
throws java.io.IOException,
org.jagatoo.util.errorhandling.IncorrectFormatException,
org.jagatoo.util.errorhandling.ParsingException
java.io.IOException
org.jagatoo.util.errorhandling.IncorrectFormatException
org.jagatoo.util.errorhandling.ParsingException
public Model loadModel(java.net.URL url,
java.lang.String filenameBase,
java.net.URL baseURL,
java.lang.String skin,
float scale,
int flags)
throws java.io.IOException,
org.jagatoo.util.errorhandling.IncorrectFormatException,
org.jagatoo.util.errorhandling.ParsingException
java.io.IOException
org.jagatoo.util.errorhandling.IncorrectFormatException
org.jagatoo.util.errorhandling.ParsingException
public final Model loadModel(java.net.URL url,
java.lang.String skin,
float scale,
int flags)
throws java.io.IOException,
org.jagatoo.util.errorhandling.IncorrectFormatException,
org.jagatoo.util.errorhandling.ParsingException
url - the URL to load the Model from.skin - the skin resource namescale - pre-scaling factorflags - loading flags
java.io.IOException
org.jagatoo.util.errorhandling.IncorrectFormatException
org.jagatoo.util.errorhandling.ParsingException
public final Model loadModel(java.net.URL url,
float scale,
int flags)
throws java.io.IOException,
org.jagatoo.util.errorhandling.IncorrectFormatException,
org.jagatoo.util.errorhandling.ParsingException
url - the URL to load the Model from.scale - pre-scaling factorflags - loading flags
java.io.IOException
org.jagatoo.util.errorhandling.IncorrectFormatException
org.jagatoo.util.errorhandling.ParsingException
public final Model loadModel(java.lang.String filename,
java.lang.String skin,
float scale,
int flags)
throws java.io.IOException,
org.jagatoo.util.errorhandling.IncorrectFormatException,
org.jagatoo.util.errorhandling.ParsingException
filename - the filename to load the Model fromskin - the skin resource namescale - pre-scaling factorflags - loading flags
java.io.IOException
org.jagatoo.util.errorhandling.IncorrectFormatException
org.jagatoo.util.errorhandling.ParsingException
public final Model loadModel(java.lang.String filename,
float scale,
int flags)
throws java.io.IOException,
org.jagatoo.util.errorhandling.IncorrectFormatException,
org.jagatoo.util.errorhandling.ParsingException
filename - the filename to load the Model fromscale - pre-scaling factorflags - loading flags
java.io.IOException
org.jagatoo.util.errorhandling.IncorrectFormatException
org.jagatoo.util.errorhandling.ParsingException
public final Model loadModel(java.net.URL url,
java.lang.String skin,
float scale)
throws java.io.IOException,
org.jagatoo.util.errorhandling.IncorrectFormatException,
org.jagatoo.util.errorhandling.ParsingException
url - the URL to load the Model from.skin - the skin resource namescale - pre-scaling factor
java.io.IOException
org.jagatoo.util.errorhandling.IncorrectFormatException
org.jagatoo.util.errorhandling.ParsingException
public final Model loadModel(java.net.URL url,
float scale)
throws java.io.IOException,
org.jagatoo.util.errorhandling.IncorrectFormatException,
org.jagatoo.util.errorhandling.ParsingException
url - the URL to load the Model from.scale - pre-scaling factorflags - loading flags
java.io.IOException
org.jagatoo.util.errorhandling.IncorrectFormatException
org.jagatoo.util.errorhandling.ParsingException
public final Model loadModel(java.lang.String filename,
java.lang.String skin,
float scale)
throws java.io.IOException,
org.jagatoo.util.errorhandling.IncorrectFormatException,
org.jagatoo.util.errorhandling.ParsingException
filename - the filename to load the Model fromskin - the skin resource namescale - pre-scaling factor
java.io.IOException
org.jagatoo.util.errorhandling.IncorrectFormatException
org.jagatoo.util.errorhandling.ParsingException
public final Model loadModel(java.lang.String filename,
float scale)
throws java.io.IOException,
org.jagatoo.util.errorhandling.IncorrectFormatException,
org.jagatoo.util.errorhandling.ParsingException
filename - the filename to load the Model fromscale - pre-scaling factor
java.io.IOException
org.jagatoo.util.errorhandling.IncorrectFormatException
org.jagatoo.util.errorhandling.ParsingException
public final Model loadModel(java.net.URL url,
java.lang.String skin)
throws java.io.IOException,
org.jagatoo.util.errorhandling.IncorrectFormatException,
org.jagatoo.util.errorhandling.ParsingException
url - the URL to load the Model from.skin - the skin resource name
java.io.IOException
org.jagatoo.util.errorhandling.IncorrectFormatException
org.jagatoo.util.errorhandling.ParsingException
public final Model loadModel(java.net.URL url)
throws java.io.IOException,
org.jagatoo.util.errorhandling.IncorrectFormatException,
org.jagatoo.util.errorhandling.ParsingException
url - the URL to load the Model from.
java.io.IOException
org.jagatoo.util.errorhandling.IncorrectFormatException
org.jagatoo.util.errorhandling.ParsingException
public final Model loadModel(java.lang.String filename,
java.lang.String skin)
throws java.io.IOException,
org.jagatoo.util.errorhandling.IncorrectFormatException,
org.jagatoo.util.errorhandling.ParsingException
filename - the filename to load the Model fromskin - the skin resource name
java.io.IOException
org.jagatoo.util.errorhandling.IncorrectFormatException
org.jagatoo.util.errorhandling.ParsingException
public final Model loadModel(java.lang.String filename)
throws java.io.IOException,
org.jagatoo.util.errorhandling.IncorrectFormatException,
org.jagatoo.util.errorhandling.ParsingException
filename - the filename to load the Model from
java.io.IOException
org.jagatoo.util.errorhandling.IncorrectFormatException
org.jagatoo.util.errorhandling.ParsingExceptionpublic static ModelLoader getInstance()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||