o3d.IndexBuffer Class Reference
Inherits
o3d.Buffer
List of all members.
Detailed Description
IndexBuffer is a buffer object used for storing geometry index data (e.g.
triangle indices).
Public Member Functions
Public Properties
Member Function Documentation
| boolean IndexBuffer.allocateElements |
( |
number |
numElements |
) |
[inherited from o3d.Buffer] |
Allocates memory for the data to be stored in the buffer based on
the types of fields set on the buffer.
- Parameters:
-
| numElements |
Number of elements to allocate.. |
- Returns:
-
boolean.True if operation was successful.
| o3d.Field IndexBuffer.createField |
( |
string |
fieldType |
|
|
|
|
number |
numComponents |
) |
[inherited from o3d.Buffer] |
Defines a field on this buffer.
Note: Creating a field after having allocated the buffer is an expensive
operation as the data currently in the buffer has to be shuffled around
to make room for the new field.
- Parameters:
-
| fieldType |
type of data in the field. Valid types are "FloatField",
"UInt32Field", "UByteNField". |
| numComponents |
number of components in the field. |
- Returns:
-
o3d.Field.The created field.
| boolean IndexBuffer.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.
Removes a field from this buffer.
Note: Removing a field after having allocated the buffer is an expensive
operation as the data currently in the buffer has to be shuffled around
to remove the old field.
- Parameters:
-
| boolean IndexBuffer.set |
( |
!Array.<number> |
values |
) |
|
Sets the values of the data stored in the buffer.
- Parameters:
-
| values |
Values to be stored in the buffer. |
- Returns:
-
boolean.True if operation was successful.
| IndexBuffer.setAt |
( |
number |
startIndex |
|
|
|
|
!Array.<number> |
values |
) |
|
Sets the values of the data stored in the buffer. The buffer must have
already been created either through buffer.set or buffer.allocateElements.
- Parameters:
-
| startIndex |
index of first value to set. |
| values |
Values to be stored in the buffer starting at index. |
Member Property Documentation
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.
Unique id of the object.
This id will be unique, even across multiple O3D clients in the same
page.
This property is read-only.
The fields currently set on the buffer.
This property is read-only.
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 IndexBuffer.numElements
[inherited from o3d.Buffer]
|
Number of elements in the buffer.
This property is read-only.
| number IndexBuffer.totalComponents
[inherited from o3d.Buffer]
|
The total components in all fields in this buffer.
This property is read-only.