Class Lw3dLoader

java.lang.Object
com.sun.j3d.loaders.lw3d.Lw3dLoader
All Implemented Interfaces:
Loader

public class Lw3dLoader extends Object implements Loader
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.
  • Field Details

    • debugPrinter

      protected com.sun.j3d.loaders.lw3d.DebugOutput debugPrinter
  • Constructor Details

    • Lw3dLoader

      public Lw3dLoader()
      Default constructor. Sets up default values for some variables.
    • Lw3dLoader

      public Lw3dLoader(int flags)
      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.
  • Method Details

    • load

      This method loads the named file and returns the Scene containing the scene. Any data files referenced by the Reader should be located in the same place as the named file; otherwise, users should specify an alternate base path with the setBaseUrl(URL) method.
      Specified by:
      load in interface Loader
      Throws:
      FileNotFoundException
      IncorrectFormatException
      ParsingErrorException
    • load

      This method loads the named file and returns the Scene containing the scene. Any data files referenced by this file should be located in the same place as the named file; otherwise users should specify an alternate base path with the setBasePath(String) method.
      Specified by:
      load in interface Loader
      Throws:
      FileNotFoundException
      IncorrectFormatException
      ParsingErrorException
    • load

      This method loads the Reader and returns the Scene containing the scene. Any data files referenced by the Reader should be located in the user's current working directory.
      Specified by:
      load in interface Loader
      Throws:
      FileNotFoundException
      IncorrectFormatException
      ParsingErrorException
    • setBaseUrl

      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. 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.
      Specified by:
      setBaseUrl in interface Loader
    • setBasePath

      public void setBasePath(String pathName)
      This method sets the base path to be used when searching for all data files within a Lightwave scene.
      Specified by:
      setBasePath in interface Loader
    • getBaseUrl

      public URL getBaseUrl()
      Returns the current base URL setting.
      Specified by:
      getBaseUrl in interface Loader
    • getBasePath

      public String getBasePath()
      Returns the current base path setting.
      Specified by:
      getBasePath in interface Loader
    • setFlags

      public void setFlags(int flags)
      This method sets the load flags for the file. The flags should equal 0 by default (which tells the loader to only load geometry).
      Specified by:
      setFlags in interface Loader
    • getFlags

      public int getFlags()
      Returns the current loading flags setting.
      Specified by:
      getFlags in interface Loader
    • getObject

      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). If no []'s exist, just pass back the first one encountered that matches.
    • debugOutputLn

      protected void debugOutputLn(int outputType, String theOutput)
    • debugOutput

      protected void debugOutput(int outputType, String theOutput)