| java.lang.Object com.sun.j3d.loaders.lw3d.TextfileParser com.sun.j3d.loaders.lw3d.Lw3dLoader
Lw3dLoader | public class Lw3dLoader extends TextfileParser implements Loader(Code) | | This class implements the Loader API and allows users to load
Lightwave 3D scene files. In order to load properly, the object
files referred to in the scene files and the image files referred
to by the object files must all be specified with path and filenames
that are valid with respect to the directory in which the application
is being executed.
|
Constructor Summary | |
public | Lw3dLoader() Default constructor. | public | Lw3dLoader(int flags) This constructor takes a flags word that specifies which types of
scenefile items should be loaded into the scene. |
Method Summary | |
void | addAmbient() | void | addBackground() Add appropriate background effects to the scene. | void | addBehaviors() | 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. | void | addFog() | void | addLights() | void | constructScene() This method creates the Scene (actually SceneBase) data structure
and adds all appropriate items to it. | public String | getBasePath() Returns the current base path setting. | public URL | getBaseUrl() Returns the current base URL setting. | int | getFileType() | public int | getFlags() Returns the current loading flags setting. | String | getInternalBasePath() | String | getInternalBaseUrl() | public TransformGroup | getObject(String name) getObject() iterates through the objectList checking the given
name against the fileName and objectName of each object in turn.
For the filename, it carves off the pathname and just checks the
final name (e.g., "missile.lwo").
If name has []'s at the end, it will use the number inside those
brackets to pick which object out of an ordered set it will
send back (objectList is created in the order that objects
exist in the file, so this order should correspond to the order
specified by the user). | public Scene | load(URL url) This method loads the named file and returns the Scene
containing the scene. | public Scene | load(String fileName) This method loads the named file and returns the Scene
containing the scene. | public Scene | load(Reader reader) This method loads the Reader and returns the Scene
containing the scene. | void | parentObjects() This method parents all objects in the scene appropriately. | public void | setBasePath(String pathName) This method sets the base path to be used when searching for all
data files within a Lightwave scene. | public void | setBaseUrl(URL url) This method sets the base URL name for data files
associated with the file passed into the load(URL) method. | public void | setFlags(int flags) This method sets the load flags for the file. | void | setInternalBasePath(String fileName) | void | setInternalBaseUrl(URL url) Creates a url for internal use. | void | setupTokenizer(StreamTokenizer tokenizer) This method sets up the StreamTokenizer for the scene file. |
FILE_TYPE_FILENAME | final static int FILE_TYPE_FILENAME(Code) | | |
FILE_TYPE_NONE | final static int FILE_TYPE_NONE(Code) | | |
FILE_TYPE_READER | final static int FILE_TYPE_READER(Code) | | |
FILE_TYPE_URL | final static int FILE_TYPE_URL(Code) | | |
ambientColor | Color3f ambientColor(Code) | | |
loadBehaviors | int loadBehaviors(Code) | | |
Lw3dLoader | public Lw3dLoader()(Code) | | Default constructor. Sets up default values for some variables.
|
Lw3dLoader | public Lw3dLoader(int flags)(Code) | | This constructor takes a flags word that specifies which types of
scenefile items should be loaded into the scene. The possible
values are specified in the com.sun.j3d.loaders.Loader class.
|
addAmbient | void addAmbient()(Code) | | Adds Ambient lighting effects to the scene
|
addBackground | void addBackground()(Code) | | Add appropriate background effects to the scene. Note that the java3d
background may not have all of the information of the lw3d background,
as the loader does not currently process items such as gradients between
the horizon and sky colors
|
addBehaviors | void addBehaviors()(Code) | | Add the behaviors to the scene
|
addCamera | void addCamera()(Code) | | 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.
To use this camera data, users can request the camera/view data
for the scene and can then insert a ViewPlatform in the transform group.
|
addFog | void addFog()(Code) | | Add appropriate fog effects to the scene
|
addLights | void addLights()(Code) | | Add any defined lights to the java3d scene
|
constructScene | void constructScene()(Code) | | This method creates the Scene (actually SceneBase) data structure
and adds all appropriate items to it. This is the data structure
that the user will get back from the load() call and inquire to
get data from the scene.
|
getBasePath | public String getBasePath()(Code) | | Returns the current base path setting.
|
getBaseUrl | public URL getBaseUrl()(Code) | | Returns the current base URL setting.
|
getFileType | int getFileType()(Code) | | |
getFlags | public int getFlags()(Code) | | Returns the current loading flags setting.
|
getObject | public TransformGroup getObject(String name)(Code) | | getObject() iterates through the objectList checking the given
name against the fileName and objectName of each object in turn.
For the filename, it carves off the pathname and just checks the
final name (e.g., "missile.lwo").
If name has []'s at the end, it will use the number inside those
brackets to pick which object out of an ordered set it will
send back (objectList is created in the order that objects
exist in the file, so this order should correspond to the order
specified by the user). If no []'s exist, just pass back the
first one encountered that matches.
|
parentObjects | void parentObjects()(Code) | | This method parents all objects in the scene appropriately. If
the scen file specifies a Parent node for the object, then the
object is parented to that node. If not, then the object is
parented to the scene's root.
|
setBasePath | public void setBasePath(String pathName)(Code) | | This method sets the base path to be used when searching for all
data files within a Lightwave scene.
|
setBaseUrl | public void setBaseUrl(URL url)(Code) | | This method sets the base URL name for data files
associated with the file passed into the load(URL) method.
The basePath should be null by default, which is an
indicator to the loader that it should look for any
associated files starting from the same directory as the
file passed into the load(URL) method.
|
setFlags | public void setFlags(int flags)(Code) | | This method sets the load flags for the file. The flags should
equal 0 by default (which tells the loader to only load geometry).
|
setInternalBasePath | void setInternalBasePath(String fileName)(Code) | | Standardizes the filename for use in the loader
|
setInternalBaseUrl | void setInternalBaseUrl(URL url)(Code) | | Creates a url for internal use. This method is not currently
used (url's are ignored for this loader; only filenames work)
|
setupTokenizer | void setupTokenizer(StreamTokenizer tokenizer)(Code) | | This method sets up the StreamTokenizer for the scene file. Note
that we're not parsing numbers as numbers because the tokenizer
does not interpret scientific notation correctly.
|
Methods inherited from com.sun.j3d.loaders.lw3d.TextfileParser | void checkString(StreamTokenizer st, String theString) throws ParsingErrorException(Code)(Java Doc) void checkType(StreamTokenizer st, int theType) throws ParsingErrorException(Code)(Java Doc) protected void debugOutput(int outputType, String theOutput)(Code)(Java Doc) protected void debugOutputLn(int outputType, String theOutput)(Code)(Java Doc) void getAndCheckString(StreamTokenizer st, String expectedValue) throws ParsingErrorException(Code)(Java Doc) String getName(StreamTokenizer st) throws ParsingErrorException(Code)(Java Doc) double getNumber(StreamTokenizer st) throws ParsingErrorException, NumberFormatException(Code)(Java Doc) String getString(StreamTokenizer st) throws ParsingErrorException(Code)(Java Doc) boolean isCurrentToken(StreamTokenizer st, String tokenString)(Code)(Java Doc) void skip(StreamTokenizer st, String tokenString, int skipVals) throws ParsingErrorException(Code)(Java Doc) void skipUntilString(StreamTokenizer st, String theString) throws ParsingErrorException(Code)(Java Doc)
|
|
|