com.jme3.scene.plugins.blender
Class BlenderModelLoader

java.lang.Object
  extended by com.jme3.scene.plugins.blender.BlenderLoader
      extended by com.jme3.scene.plugins.blender.BlenderModelLoader
All Implemented Interfaces:
AssetLoader

public class BlenderModelLoader
extends BlenderLoader

This is the main loading class. Have in notice that asset manager needs to have loaders for resources like textures.


Field Summary
protected  BlenderContext blenderContext
           
 
Fields inherited from class com.jme3.scene.plugins.blender.BlenderLoader
blocks
 
Constructor Summary
BlenderModelLoader()
           
 
Method Summary
 Spatial load(AssetInfo assetInfo)
          Loads asset from the given input stream, parsing it into an application-usable object.
 Camera toCamera(Structure structure)
          This method converts the given structure to a camera.
 Light toLight(Structure structure)
          This method converts the given structure to a light.
 java.util.List<Geometry> toMesh(Structure structure)
          This method converts the given structure to a list of geometries.
 java.lang.Object toObject(Structure structure)
          This method converts the given structure to a node.
 Node toScene(Structure structure)
          This method converts the given structure to a scene node.
 BlenderKey.WorldData toWorldData(Structure structure)
          This method returns the data read from the WORLD file block.
 
Methods inherited from class com.jme3.scene.plugins.blender.BlenderLoader
isRootObject, setup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

blenderContext

protected BlenderContext blenderContext
Constructor Detail

BlenderModelLoader

public BlenderModelLoader()
Method Detail

load

public Spatial load(AssetInfo assetInfo)
             throws java.io.IOException
Description copied from interface: AssetLoader
Loads asset from the given input stream, parsing it into an application-usable object.

Specified by:
load in interface AssetLoader
Overrides:
load in class BlenderLoader
Returns:
An object representing the resource.
Throws:
java.io.IOException - If an I/O error occurs while loading

toScene

public Node toScene(Structure structure)
This method converts the given structure to a scene node.

Parameters:
structure - structure of a scene
Returns:
scene's node

toCamera

public Camera toCamera(Structure structure)
                throws BlenderFileException
This method converts the given structure to a camera.

Parameters:
structure - structure of a camera
Returns:
camera's node
Throws:
BlenderFileException

toLight

public Light toLight(Structure structure)
              throws BlenderFileException
This method converts the given structure to a light.

Parameters:
structure - structure of a light
Returns:
light's node
Throws:
BlenderFileException

toObject

public java.lang.Object toObject(Structure structure)
                          throws BlenderFileException
This method converts the given structure to a node.

Parameters:
structure - structure of an object
Returns:
object's node
Throws:
BlenderFileException

toMesh

public java.util.List<Geometry> toMesh(Structure structure)
                                throws BlenderFileException
This method converts the given structure to a list of geometries.

Parameters:
structure - structure of a mesh
Returns:
list of geometries
Throws:
BlenderFileException

toWorldData

public BlenderKey.WorldData toWorldData(Structure structure)
This method returns the data read from the WORLD file block. The block contains data that can be stored as separate jme features and therefore cannot be returned as a single jME scene feature.

Parameters:
structure - the structure with WORLD block data
Returns:
data read from the WORLD block that can be added to the scene