public interface AVLoader
Loaders provide a common interface regardless of the type of file format that is being loaded. The flags allow you to control exactly what should be created from a loading process. For example, many applications only want the static geometry to be loaded, while ignoring any animation data provided. Many of the more complex model formats, such as those that come from modelling tools like 3DS Max or Maya include a wealth of useful renderable structure, and also a lot of useless stuff, such as parameters for the editor configuration or raytracing parameters. These are ignored by the loader interface as it focuses on working with realtime model data only.
Behavioural Requirements The default behaviour of a loader implementation, should the user not set any flags shall be as follows:
load() is independent. No state is kept
between calls other than flag settings.| Modifier and Type | Field and Description |
|---|---|
static int |
BACKGROUNDS
Load the background(s) defined in the file
|
static int |
FOGS
Load the fogs defined in the file
|
static int |
GEOMETRY
Load the geometry and structural portions of the file
|
static int |
LAYERS
Load the layers defined in the file
|
static int |
LIGHTS
Load the lights defined in the file
|
static int |
LOAD_ALL
Load everything in the file
|
static int |
RUNTIMES
Load code that will handling any runtime capabilities (such as
animation) defined in the file.
|
static int |
VIEWPOINTS
Load the viewpoints defined in the file
|
| Modifier and Type | Method and Description |
|---|---|
int |
getLoadFlags()
Get the current set collection of load flags.
|
boolean |
isInternalModelKept()
Check to see whether the loader should be currently keeping the internal
model.
|
void |
keepInternalModel(boolean enable)
Define whether this loader should also keep around it's internal
representation of the file format, if it has one.
|
AVModel |
load(File file)
Load a model from the given file.
|
AVModel |
load(InputStream stream)
Load a model from the given input stream.
|
AVModel |
load(URL url)
Load a model from the given URL.
|
void |
setLoadFlags(int flags)
Set the flags for which parts of the file that should be loaded.
|
static final int GEOMETRY
static final int BACKGROUNDS
static final int VIEWPOINTS
static final int RUNTIMES
static final int FOGS
static final int LIGHTS
static final int LAYERS
static final int LOAD_ALL
AVModel load(URL url) throws IOException
url - The url to load the model fromIOException - something went wrong while reading the fileAVModel load(InputStream stream) throws IOException
Reader interface, then use the
InputStreamReader to convert this stream to the desired
type. The caller will be responsible for closing down the stream at the
end of this process.stream - The stream to load the model fromIOException - something went wrong while reading the fileAVModel load(File file) throws IOException
file - The file instance to load the model fromIOException - something went wrong while reading the filevoid setLoadFlags(int flags)
flags - The collection of flags to useint getLoadFlags()
void keepInternalModel(boolean enable)
AVModel.getRawModel() method and cast to
the appropriate class type.enable - true to enable keeping the raw model, false otherwiseboolean isInternalModelKept()
Copyright © 2001 - 2015 j3d.org