Constants for WebGL index datatypes. These corresponds to the
type parameter of drawElements.
Source:
Core/IndexDatatype.js, line 21
Members
-
staticconstantIndexDatatype.UNSIGNED_BYTE :Number
-
0x1401. 8-bit unsigned byte corresponding to
UNSIGNED_BYTEand the type of an element inUint8Array.Source: Core/IndexDatatype.js, line 29 -
staticconstantIndexDatatype.UNSIGNED_INT :Number
-
0x1405. 32-bit unsigned int corresponding to
UNSIGNED_INTand the type of an element inUint32Array.Source: Core/IndexDatatype.js, line 47 -
staticconstantIndexDatatype.UNSIGNED_SHORT :Number
-
0x1403. 16-bit unsigned short corresponding to
UNSIGNED_SHORTand the type of an element inUint16Array.Source: Core/IndexDatatype.js, line 38
Methods
-
staticIndexDatatype.createTypedArray(numberOfVertices, indicesLengthOrArray) → Uint16Array|Uint32Array
-
Creates a typed array that will store indices, using either
or Uint32Arraydepending on the number of vertices.Name Type Description numberOfVerticesNumber Number of vertices that the indices will reference. indicesLengthOrArrayAny Passed through to the typed array constructor. Returns:
AUint16ArrayorUint32Arrayconstructed withindicesLengthOrArray.Example:
this.indices = Cesium.IndexDatatype.createTypedArray(positions.length / 3, numberOfIndices);Source: Core/IndexDatatype.js, line 104 -
staticIndexDatatype.createTypedArrayFromArrayBuffer(numberOfVertices, sourceArray, byteOffset, length) → Uint16Array|Uint32Array
-
Creates a typed array from a source array buffer. The resulting typed array will store indices, using either
or Uint32Arraydepending on the number of vertices.Name Type Description numberOfVerticesNumber Number of vertices that the indices will reference. sourceArrayArrayBuffer Passed through to the typed array constructor. byteOffsetNumber Passed through to the typed array constructor. lengthNumber Passed through to the typed array constructor. Returns:
AUint16ArrayorUint32Arrayconstructed withsourceArray,byteOffset, andlength.Source: Core/IndexDatatype.js, line 129 -
staticIndexDatatype.getSizeInBytes(indexDatatype) → Number
-
Returns the size, in bytes, of the corresponding datatype.
Name Type Description indexDatatypeIndexDatatype The index datatype to get the size of. Returns:
The size in bytes.Example:
// Returns 2 var size = Cesium.IndexDatatype.getSizeInBytes(Cesium.IndexDatatype.UNSIGNED_SHORT);Source: Core/IndexDatatype.js, line 60 -
staticIndexDatatype.validate(indexDatatype) → Boolean
-
Validates that the provided index datatype is a valid
IndexDatatype.Name Type Description indexDatatypeIndexDatatype The index datatype to validate. Returns:
trueif the provided index datatype is a valid value; otherwise,false.Example:
if (!Cesium.IndexDatatype.validate(indexDatatype)) { throw new Cesium.DeveloperError('indexDatatype must be a valid value.'); }Source: Core/IndexDatatype.js, line 86
