org.jdesktop.wonderland.client.jme.artimport
Interface ModelLoader


public interface ModelLoader

Interface for Model loader code. Provides support for inital import of the model from its original art files, deployment of the assets into a module and runtime load of the assets from the module

Author:
paulby

Method Summary
 java.util.List<java.net.URL> assetLoaded(DeployedModel model, java.net.URL url, java.io.InputStream loaded)
          Get a list of additional assets based on loading the given asset
 DeployedModel deployToModule(java.io.File moduleRootDir, ImportedModel importedModel)
          Deploy the art content to the module.
 java.util.List<java.net.URL> getAssets(DeployedModel model)
          Get a list of asset URLs for the given model
 ModelCellServerState getCellServerState(java.lang.String deployedURL, com.jme.math.Vector3f modelTranslation, com.jme.math.Quaternion modelRotation, com.jme.math.Vector3f modelScale, java.util.Map<java.lang.String,java.lang.Object> properties)
          Return a cell server state object that will cause the appropriate cell for the model to be create on the server.
 ImportedModel importModel(ImportSettings settings)
          Import the model from it's original source
 com.jme.scene.Node loadDeployedModel(DeployedModel model, org.jdesktop.mtgame.Entity rootEntity)
          Given a previously deploy model, load the model.
 

Method Detail

importModel

ImportedModel importModel(ImportSettings settings)
                          throws java.io.IOException
Import the model from it's original source

Parameters:
file -
Returns:
Throws:
java.io.IOException

loadDeployedModel

com.jme.scene.Node loadDeployedModel(DeployedModel model,
                                     org.jdesktop.mtgame.Entity rootEntity)
Given a previously deploy model, load the model.

Parameters:
model - the model to load
rootEntity - the entity to which the returned node will be attached.

deployToModule

DeployedModel deployToModule(java.io.File moduleRootDir,
                             ImportedModel importedModel)
                             throws java.io.IOException
Deploy the art content to the module.

Parameters:
rootDir - the art root directory of the module (usually /art)
Throws:
java.io.IOException

getCellServerState

ModelCellServerState getCellServerState(java.lang.String deployedURL,
                                        com.jme.math.Vector3f modelTranslation,
                                        com.jme.math.Quaternion modelRotation,
                                        com.jme.math.Vector3f modelScale,
                                        java.util.Map<java.lang.String,java.lang.Object> properties)
Return a cell server state object that will cause the appropriate cell for the model to be create on the server.

Parameters:
deployedURL - the url of the deployed art file
modelTranslation - the translation of the model, relative to the cell
modelRotation - the rotation of the model, relative to the cell
modelScale - the scale of the model, relative to the cell
properties - set of loader specific properties, may be null
Returns:
a cell server state object

getAssets

java.util.List<java.net.URL> getAssets(DeployedModel model)
                                       throws java.io.IOException
Get a list of asset URLs for the given model

Parameters:
model - the model to get URLs for
Returns:
the asset URLs to load, or an empty list if there are no URLs.
Throws:
java.io.IOException

assetLoaded

java.util.List<java.net.URL> assetLoaded(DeployedModel model,
                                         java.net.URL url,
                                         java.io.InputStream loaded)
                                         throws java.io.IOException
Get a list of additional assets based on loading the given asset

Parameters:
model - the model to load urls for
url - the URL that was loaded
loaded - the input stream of data
Returns:
the additional asset URLs to load, or an empty list if there are no URLs
Throws:
java.io.IOException


Open Wonderland - http://openwonderland.org