Class vxlModelManager

Controls the loading and network transfer of models into memory

Constructor

vxlModelManager()
Creates vxlModel objects and assigns them to a vxlScene. vxlModelManager provides methods for loading remote and local models.
Author: Diego Cantor.

Methods

.add(p_object, p_scene)

Parameters:

Type Name Description
Object p_object

the JSON object that contains the definition of the model oran instance of vxlModel. The object must have a 'name' property.

vxlScene p_scene

the scene to be called back when the model is created

.allLoaded()
Returns true if all the models in the list passed to the method loadList have been loaded.
.getModelByName(name)
Returns the model if it has been loaded by this model manager, null otherwise.

Parameters:

Type Name Description
String name

the name of the model to retrieve

.handleEvent(event, source)
Handles voxelent events to which this model manager is subscribed to

Parameters:

Type Name Description
String event

the event that was fired

Object source

the object that fired the event

.isModelLoaded(name)
Checks if a model has been loaded yet

Parameters:

Type Name Description
String name

the name of the model to check

.load(uri, scene)
Uses a JSON/Ajax mechanism to load models from a Web Server.

Parameters:

Type Name Description
String uri

The path to the file that will be loaded.

vxlScene scene

The scene that will create an actor for this model. This parameter is optional.

.loadList(list, scene)
Loads a list of models and assigns them to a scene

Parameters:

Type Name Description
Array list

list of files to load

vxlScene scene

scene to callback when the models are loaded

.reset()
It will delete all of the loaded models