WebGL component datatypes. Components are intrinsics,
which form attributes, which form vertices.
Members
-
64-bit floating-point corresponding to
gl.DOUBLE(in Desktop OpenGL; this is not supported in WebGL, and is emulated in Cesium viaGeometryPipeline.encodeAttribute) and the type of an element inFloat64Array.-
Default Value:
0x140A -
32-bit signed int corresponding to
INTand the type of an element inInt32Array. -
32-bit unsigned int corresponding to
UNSIGNED_INTand the type of an element inUint32Array. -
8-bit signed byte corresponding to
gl.BYTEand the type of an element inInt8Array. -
32-bit floating-point corresponding to
FLOATand the type of an element inFloat32Array. -
16-bit signed short corresponding to
SHORTand the type of an element inInt16Array. -
8-bit unsigned byte corresponding to
UNSIGNED_BYTEand the type of an element inUint8Array. -
16-bit unsigned short corresponding to
UNSIGNED_SHORTand the type of an element inUint16Array.
Methods
-
Creates a typed view of an array of bytes.
Name Type Description componentDatatypeComponentDatatype The type of the view to create. bufferArrayBuffer The buffer storage to use for the view. byteOffsetNumber optional The offset, in bytes, to the first element in the view. lengthNumber optional The number of elements in the view. Returns:
A typed array view of the buffer.Throws:
-
DeveloperError : componentDatatype is not a valid value.
-
-
Creates a typed array corresponding to component data type.
Name Type Description componentDatatypeComponentDatatype The component data type. valuesOrLengthNumber | Array The length of the array to create or an array. Returns:
A typed array.Throws:
-
DeveloperError : componentDatatype is not a valid value.
Example:
// creates a Float32Array with length of 100 var typedArray = Cesium.ComponentDatatype.createTypedArray(Cesium.ComponentDatatype.FLOAT, 100); -
-
staticCesium.ComponentDatatype.fromName(name) → ComponentDatatype
-
Get the ComponentDatatype from its name.
Name Type Description nameString The name of the ComponentDatatype. Returns:
The ComponentDatatype.Throws:
-
DeveloperError : name is not a valid value.
-
-
staticCesium.ComponentDatatype.fromTypedArray(array) → ComponentDatatype
-
Gets the
ComponentDatatypefor the provided TypedArray instance.Name Type Description arrayTypedArray The typed array. Returns:
The ComponentDatatype for the provided array, or undefined if the array is not a TypedArray. -
Returns the size, in bytes, of the corresponding datatype.
Name Type Description componentDatatypeComponentDatatype The component datatype to get the size of. Returns:
The size in bytes.Throws:
-
DeveloperError : componentDatatype is not a valid value.
Example:
// Returns Int8Array.BYTES_PER_ELEMENT var size = Cesium.ComponentDatatype.getSizeInBytes(Cesium.ComponentDatatype.BYTE); -
-
Validates that the provided component datatype is a valid
ComponentDatatypeName Type Description componentDatatypeComponentDatatype The component datatype to validate. Returns:
trueif the provided component datatype is a valid value; otherwise,false.Example:
if (!Cesium.ComponentDatatype.validate(componentDatatype)) { throw new Cesium.DeveloperError('componentDatatype must be a valid value.'); }
