|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jmex.model.ogrexml.SceneLoader
public class SceneLoader
Loads dotScene files.
Note that multiple load invocations will add to the scene node managed by this instance. Therefore, if you want to obtain separate scene nodes for multiple dotScene files, you must use a separate SceneLoader instance for each load()+getScene().
Constructor Summary | |
---|---|
SceneLoader()
|
Method Summary | |
---|---|
void |
addMaterials(java.util.Map<java.lang.String,Material> newMaterials)
Reuse an existing Materials collection. |
Camera |
getCamera()
Deprecated. This class no longer manages cameras. |
java.util.Map<java.lang.String,Material> |
getMaterials()
Use this method to re-use the Materials loaded by this SceneLoader for other purposes, such as to load other dotScene or Mesh files. |
Node |
getScene()
|
boolean |
isModelsOnly()
|
void |
load(java.io.InputStream in)
Adds data from the specified dotScene file onto a scene node (which may then be retrieved with getScene(). |
void |
load(org.w3c.dom.Node sceneXmlNode)
|
void |
load(java.net.URI uri)
Convenience wrapper |
void |
load(java.net.URL url)
Adds contents of dotScene file at specified URI onto a scene node, automatically adding the containing directory to the resource locator paths for the duration of the load. |
void |
loadEnvironment(org.w3c.dom.Node env)
|
void |
loadExternals(org.w3c.dom.Node externals)
|
void |
loadNode(Node targetJmeNode,
org.w3c.dom.Node sourceXmlNode)
Populates the specified jME Node with data from the specified XML Node. |
void |
setModelsOnly(boolean modelsOnly)
Specify whether you want to load just models from the dotScene file. |
void |
setName(java.lang.String newName)
This method is provided so that users can import multiple dotScene files and have unique top-level nodes for each load; or if you just want to specify your own top-level node name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SceneLoader()
Method Detail |
---|
@Deprecated public Camera getCamera()
public boolean isModelsOnly()
setModelsOnly(boolean)
public void setModelsOnly(boolean modelsOnly)
If you set modelsOnly to true before running a load() method, then
This setter must be called between SceneLoader instantiation and .load() invocation.
public void loadNode(Node targetJmeNode, org.w3c.dom.Node sourceXmlNode) throws java.io.IOException, ModelFormatException
The Ogre exporter and Blender generally use node-type-specific name spaces for node names. Consequently, the Ogre dotScene exporter generates the same name for nodes and for the first entity child thereof. To maintain jME-preferred scene Spatial name uniqueness, we append the suffix "DotNode" to the node names in the dotScene file.
targetJmeNode
- An unpopulated com.jme.scene.Node.
We will consitute the node and add its descendants.sourceXmlNode
- XML node which children will be reaped from.
java.io.IOException
ModelFormatException
public void loadExternals(org.w3c.dom.Node externals) throws java.io.IOException
java.io.IOException
public void loadEnvironment(org.w3c.dom.Node env)
public void load(org.w3c.dom.Node sceneXmlNode) throws java.io.IOException, ModelFormatException
java.io.IOException
ModelFormatException
public Node getScene()
public void load(java.io.InputStream in) throws java.io.IOException, ModelFormatException
java.io.IOException
ModelFormatException
getScene()
public void load(java.net.URI uri) throws java.io.IOException, ModelFormatException
java.io.IOException
ModelFormatException
load(URL)
public void load(java.net.URL url) throws java.io.IOException, ModelFormatException
An example of invoking this method for a filesystem file:
ogreSceneLoader.load(file.toURL());
java.io.IOException
ModelFormatException
getScene()
,
RelativeResourceLocator
public void setName(java.lang.String newName)
This method is not necessary for uniqueness purposes if you use the load(URL) method, unless your target URLs happen to have the same file base name (without the preceding path and following suffix).
This setter must be called between SceneLoader instantiation and .load() invocation.
public java.util.Map<java.lang.String,Material> getMaterials()
public void addMaterials(java.util.Map<java.lang.String,Material> newMaterials)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |