public class Lw3dLoader extends TextfileParser implements Loader
| Modifier and Type | Field and Description |
|---|---|
(package private) Color3f |
ambientColor |
(package private) LwsBackground |
background |
(package private) java.lang.String |
basePath |
(package private) java.net.URL |
baseUrl |
(package private) LwsCamera |
camera |
(package private) static int |
FILE_TYPE_FILENAME |
(package private) static int |
FILE_TYPE_NONE |
(package private) static int |
FILE_TYPE_READER |
(package private) static int |
FILE_TYPE_URL |
(package private) int |
fileType |
(package private) LwsFog |
fog |
(package private) java.lang.String |
internalBasePath |
(package private) java.lang.String |
internalBaseUrl |
(package private) java.util.Vector |
lightList |
(package private) int |
loadBehaviors |
(package private) int |
loadFlags |
(package private) java.util.Vector |
objectList |
(package private) SceneBase |
scene |
(package private) java.util.Vector |
sceneBehaviors |
(package private) BranchGroup |
sceneGroupNode |
currentLevel, debugPrinter, EXCEPTION, LINE_TRACE, lineSeparatorChar, MISC, NONE, NUMBER, TIME, TRACE, VALUES, WORDLOAD_ALL, LOAD_BACKGROUND_NODES, LOAD_BEHAVIOR_NODES, LOAD_FOG_NODES, LOAD_LIGHT_NODES, LOAD_SOUND_NODES, LOAD_VIEW_GROUPS| Constructor and Description |
|---|
Lw3dLoader()
Default constructor.
|
Lw3dLoader(int flags)
This constructor takes a flags word that specifies which types of
scenefile items should be loaded into the scene.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
addAmbient()
Adds Ambient lighting effects to the scene
|
(package private) void |
addBackground()
Add appropriate background effects to the scene.
|
(package private) void |
addBehaviors()
Add the behaviors to the scene
|
(package private) void |
addCamera()
Adds the Camera's transform group to the scene, either by parenting
it to the appropriate object or by adding it to the scene root.
|
(package private) void |
addFog()
Add appropriate fog effects to the scene
|
(package private) void |
addLights()
Add any defined lights to the java3d scene
|
(package private) void |
constructScene()
This method creates the Scene (actually SceneBase) data structure
and adds all appropriate items to it.
|
java.lang.String |
getBasePath()
Returns the current base path setting.
|
java.net.URL |
getBaseUrl()
Returns the current base URL setting.
|
(package private) int |
getFileType() |
int |
getFlags()
Returns the current loading flags setting.
|
(package private) java.lang.String |
getInternalBasePath() |
(package private) java.lang.String |
getInternalBaseUrl() |
TransformGroup |
getObject(java.lang.String name)
getObject() iterates through the objectList checking the given
name against the fileName and objectName of each object in turn.
|
Scene |
load(java.io.Reader reader)
This method loads the Reader and returns the Scene
containing the scene.
|
Scene |
load(java.lang.String fileName)
This method loads the named file and returns the Scene
containing the scene.
|
Scene |
load(java.net.URL url)
This method loads the named file and returns the Scene
containing the scene.
|
(package private) void |
parentObjects()
This method parents all objects in the scene appropriately.
|
void |
setBasePath(java.lang.String pathName)
This method sets the base path to be used when searching for all
data files within a Lightwave scene.
|
void |
setBaseUrl(java.net.URL url)
This method sets the base URL name for data files
associated with the file passed into the load(URL) method.
|
void |
setFlags(int flags)
This method sets the load flags for the file.
|
(package private) void |
setInternalBasePath(java.lang.String fileName)
Standardizes the filename for use in the loader
|
(package private) void |
setInternalBaseUrl(java.net.URL url)
Creates a url for internal use.
|
(package private) void |
setupTokenizer(java.io.StreamTokenizer tokenizer)
This method sets up the StreamTokenizer for the scene file.
|
checkString, checkType, debugOutput, debugOutputLn, getAndCheckString, getName, getNumber, getString, isCurrentToken, skip, skipUntilStringjava.util.Vector objectList
java.util.Vector lightList
BranchGroup sceneGroupNode
Color3f ambientColor
LwsCamera camera
LwsFog fog
LwsBackground background
int loadFlags
int loadBehaviors
java.util.Vector sceneBehaviors
SceneBase scene
java.lang.String basePath
java.lang.String internalBasePath
java.net.URL baseUrl
java.lang.String internalBaseUrl
static final int FILE_TYPE_NONE
static final int FILE_TYPE_URL
static final int FILE_TYPE_FILENAME
static final int FILE_TYPE_READER
int fileType
public Lw3dLoader()
public Lw3dLoader(int flags)
public Scene load(java.net.URL url) throws java.io.FileNotFoundException, IncorrectFormatException, ParsingErrorException
load in interface Loaderjava.io.FileNotFoundExceptionIncorrectFormatExceptionParsingErrorExceptionpublic Scene load(java.lang.String fileName) throws java.io.FileNotFoundException, IncorrectFormatException, ParsingErrorException
load in interface Loaderjava.io.FileNotFoundExceptionIncorrectFormatExceptionParsingErrorExceptionpublic Scene load(java.io.Reader reader) throws java.io.FileNotFoundException, IncorrectFormatException, ParsingErrorException
load in interface Loaderjava.io.FileNotFoundExceptionIncorrectFormatExceptionParsingErrorExceptionvoid constructScene()
void setInternalBaseUrl(java.net.URL url)
void setInternalBasePath(java.lang.String fileName)
java.lang.String getInternalBasePath()
java.lang.String getInternalBaseUrl()
int getFileType()
void parentObjects()
public void setBaseUrl(java.net.URL url)
setBaseUrl in interface Loaderpublic void setBasePath(java.lang.String pathName)
setBasePath in interface Loaderpublic java.net.URL getBaseUrl()
getBaseUrl in interface Loaderpublic java.lang.String getBasePath()
getBasePath in interface Loaderpublic void setFlags(int flags)
public int getFlags()
public TransformGroup getObject(java.lang.String name)
void setupTokenizer(java.io.StreamTokenizer tokenizer)
void addAmbient()
void addLights()
void addCamera()
void addFog()
void addBehaviors()
void addBackground()
Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.