My favorites | English | Sign in

o3d.ParamArray Class Reference

Inherits o3d.NamedObject

List of all members.


Detailed Description

A ParamArray is an object that holds an array of Params.

Public Member Functions

o3d.Param  createParam(index, paramTypeName) o3d.ParamArray
o3d.Param  getParam(index) o3d.ParamArray
boolean  isAClassName(className) o3d.ObjectBase
removeParams(startIndex, numToRemove) o3d.ParamArray
resize(numParams, paramTypeName) o3d.ParamArray

Public Properties

string className o3d.ObjectBase
number clientId o3d.ObjectBase
number length o3d.ParamArray
string name o3d.NamedObject
!Array.<!o3d.Param> params o3d.ParamArray

Member Function Documentation

o3d.Param ParamArray.createParam ( number index
string paramTypeName )

Creates a Param of the given type at the index requested. If a Param already exists at that index the new param will be replace it. If the index is past the end of the current array params of the requested type will be created to fill out the array to the requested index.

Parameters:
index index at which to create new param.
paramTypeName The type of Param to create. For a list of valid types see ParamObject.createParam
Returns:
o3d.Param.Param created at index or null if failure.
o3d.Param ParamArray.getParam ( number index )

Gets a Param by index.

Parameters:
index Index of Param to get.
Returns:
o3d.Param.The Param at index, or null if out of range.
boolean ParamArray.isAClassName ( string className ) [inherited from o3d.ObjectBase]

Takes the name of a class as an argument, and returns true if this object is either an instance of that class or derives from that class.

var t = pack.createObject('o3d.Transform');
t.isAClassName('o3d.Transform');    // true
t.isAClassName('o3d.ParamObject');  // true
t.isAClassName('o3d.Shape');        // false
Parameters:
className Name of class to check for.
Returns:
boolean.true if this object is a or is derived from the given class name.
ParamArray.removeParams ( number startIndex
number numToRemove )

Removes a range of params.

Parameters:
startIndex Index of first param to remove.
numToRemove The number of params to remove starting at start_index.
ParamArray.resize ( number numParams
string paramTypeName )

Resizes the array.

Parameters:
numParams The number of params to make the array.
paramTypeName The type of Param to create if resizing requires params to be created. For a list of valid types see ParamObject.createParam

Member Property Documentation

string ParamArray.className [inherited from o3d.ObjectBase]

The concrete class name for an object derived from ObjectBase. If you want to know if an object is of a certain type you should use objectBase.isAClassName

var t = pack.createObject('o3d.Transform');
t.className == 'o3d.Transform';  // true
This property is read-only.
number ParamArray.clientId [inherited from o3d.ObjectBase]

Unique id of the object. This id will be unique, even across multiple O3D clients in the same page. This property is read-only.

number ParamArray.length

Returns the number of parameters in this ParamArray. This property is read-only.

string ParamArray.name [inherited from o3d.NamedObject]

The object's name. Setting this has no meaning to O3D, but is useful for debugging and for the functions Client.getObjects, Pack.getObject, RenderNode.getRenderNodesByNameInTree and RenderNode.getTransformsByNameInTree which search for objects by name.

!Array.<!o3d.Param> ParamArray.params

Gets all the param on this param object. Each access to this field gets the entire list, so it is best to get it just once. For example:

var params = ParamArray.params;
for (var i = 0; i < params.length; i++) {
  var param = params[i];
}
Note that modifications to this array [e.g. push()] will not affect the underlying ParamObject, while modifications to the array's members will affect them. This property is read-only.