Class vxlModel

Represents a geometric object. A model is represented by an actor in a scene.

Constructor

vxlModel(name, JSON_OBJECT)
Models are totally independent of views and of the rendering process
Author: Diego Cantor.

Parameters:

String name

the name for this model

Object JSON_OBJECT

the JSON Object that defines this model (Optional)

See:
vxlModel#load

Fields

<static> vxlModel.BB_INDICES
Indices to draw the bounding box. The vertices in this case will correspondto the actor bounding box calculation

Methods

.computeBoundingBox()
Calculate the bounding box of this model and its centre
.computeNormals()
Calculates the normals for this model in case that the JSON object does not include them
.computeWireframeIndices()
Generate the wireframe indices using the model indices
.flipNormals()
Flips the normals
.getBoundingBoxVertices()
Returns the bounding box vertices. This method is used by the rendering engine
.load(nm, JSON_OBJECT)
Populates this model with the JSON_OBJECT (JSON object)

Parameters:

Type Name Description
String nm

the name given to this model

Object JSON_OBJECT

the JSON object that describes the model

.setType(type)
Sets the type of model. A renderable object is created and associatedwith this model in case the type is MESH or BIG_DATA

Parameters:

Type Name Description
vxl.def.model.type type

the type of model

.update()
Update model state when the model has changed (changes in vertices or indices)