My favorites | English | Sign in

o3d.Field Class Reference

Inherits o3d.NamedObject

List of all members.


Detailed Description

A Field is a base class that manages a set of components in a Buffer of a specific type. Fields are managed by Buffers and can not be directly created. When a Buffer is destroyed or if a Field is removed from a Buffer the Field's buffer property will be set to null.

Public Member Functions

boolean  isAClassName(className) o3d.ObjectBase

Public Properties

o3d.Buffer buffer o3d.Field
string className o3d.ObjectBase
number clientId o3d.ObjectBase
string name o3d.NamedObject
number numComponents o3d.Field
number offset o3d.Field
number size o3d.Field

Member Function Documentation

boolean Field.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.

Member Property Documentation

o3d.Buffer Field.buffer

The Buffer the field belongs to. This property is read-only.

string Field.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 Field.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.

string Field.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.

number Field.numComponents

The number of components in this field. This property is read-only.

number Field.offset

The offset of this field in the Buffer in bytes. This property is read-only.

number Field.size

The size of one element of this field. This property is read-only.