IndexDatatype
Enumerations for WebGL index datatypes. These corresponds to the
type parameter of drawElements.
Source:
Members
-
<static, constant> UNSIGNED_BYTE :Enumeration
-
8-bit unsigned byte enumeration corresponding to
UNSIGNED_BYTEand the type of an element inUint8Array.- Default Value:
- 0x1401
-
<static, constant> UNSIGNED_INT :Enumeration
-
32-bit unsigned int enumeration corresponding to
UNSIGNED_INTand the type of an element inUint32Array.- Default Value:
- 0x1405
-
<static, constant> UNSIGNED_SHORT :Enumeration
-
16-bit unsigned short enumeration corresponding to
UNSIGNED_SHORTand the type of an element inUint16Array.- Default Value:
- 0x1403
Methods
-
<static> createTypedArray
-
Creates a typed array that will store indices, using either
or Uint32Arraydepending on the number of vertices.Parameters:
Name Type Description numberOfVerticesNumber Number of vertices that the indices will reference. indicesLengthOrArrayAny Passed through to the typed array constructor. Throws:
DeveloperError : center is required.Returns:
Array AUint16ArrayorUint32Arrayconstructed withindicesLengthOrArray.Example
this.indices = IndexDatatype.createTypedArray(positions.length / 3, numberOfIndices);
-
<static> validate
-
Validates that the provided index datatype is a valid IndexDatatype.
Parameters:
Name Type Description indexDatatypeIndexDatatype The index datatype to validate. Returns:
Booleantrueif 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.'); }
