IndexDatatype

IndexDatatype

Enumerations for WebGL index datatypes. These corresponds to the type parameter of drawElements.

Source:

Members

<static, constant> :Enumeration

8-bit unsigned byte enumeration corresponding to UNSIGNED_BYTE and the type of an element in Uint8Array.
Default Value:
  • 0x1401

<static, constant> :Enumeration

32-bit unsigned int enumeration corresponding to UNSIGNED_INT and the type of an element in Uint32Array.
Default Value:
  • 0x1405

<static, constant> :Enumeration

16-bit unsigned short enumeration corresponding to UNSIGNED_SHORT and the type of an element in Uint16Array.
Default Value:
  • 0x1403

Methods

<static>

Creates a typed array that will store indices, using either or Uint32Array depending on the number of vertices.

Parameters:
Name Type Description
numberOfVertices Number Number of vertices that the indices will reference.
indicesLengthOrArray Any Passed through to the typed array constructor.
Throws:
DeveloperError : center is required.
Returns:
Array A Uint16Array or Uint32Array constructed with indicesLengthOrArray.
Example
this.indices = IndexDatatype.createTypedArray(positions.length / 3, numberOfIndices);

<static>

Validates that the provided index datatype is a valid IndexDatatype.

Parameters:
Name Type Description
indexDatatype IndexDatatype The index datatype to validate.
Returns:
Boolean true if the provided index datatype is a valid enumeration value; otherwise, false.
Example
if (!IndexDatatype.validate(indexDatatype)) {
  throw new DeveloperError('indexDatatype must be a valid enumeration value.');
}
Documentation generated by JSDoc 3 on Fri Nov 01 2013 09:47:22 GMT-0400 (EDT)