sourceData

vgl. sourceData

new sourceData(arg) → {vgl.sourceData}

Description:
  • Create a new instance of class sourceData.

Source:
Parameters:
Name Type Description
arg object
Properties
Name Type Attributes Description
name string <nullable>

Name of the source

Returns:
Type
vgl.sourceData

Methods

addAttribute(key, dataType, sizeOfDataType, offset, stride, noOfComponents, normalized)

Description:
  • Add new attribute data to the source.

Source:
Parameters:
Name Type Description
key string

Attribute key.

dataType number
sizeOfDataType number
offset number
stride number
noOfComponents number
normalized boolean

attributeDataType(key) → {number}

Description:
  • Return attribute data type.

Source:
Parameters:
Name Type Description
key string

Attribute key.

Returns:
Type
number

attributeNumberOfComponents(key) → {number}

Description:
  • Return number of components of the attribute data.

Source:
Parameters:
Name Type Description
key string

Attribute key.

Returns:
Type
number

attributeOffset(key) → {number}

Description:
  • Return attribute offset.

Source:
Parameters:
Name Type Description
key string

Attribute key.

Returns:
Type
number

attributeStride(key) → {number}

Description:
  • Return attribute stride.

Source:
Parameters:
Name Type Description
key string

Attribute key.

Returns:
Type
number

data() → {Array|Float32Array}

Description:
  • Return raw data for this source.

Source:
Returns:
Type
Array | Float32Array

dataToFloat32Array() → {Float32Array}

Description:
  • If the raw data is not a Float32Array, convert it to one. Then, return raw data for this source.

Source:
Returns:
Type
Float32Array

getData() → {Array|Float32Array}

Description:
  • Return raw data for this source.

Source:
Returns:
Type
Array | Float32Array

hasKey(key) → {boolean}

Description:
  • Check if there is attribute exists of a given key type.

Source:
Parameters:
Name Type Description
key string

Attribute key.

Returns:
Type
boolean

insert(data)

Description:
  • Insert new data block to the raw data.

Source:
Parameters:
Name Type Description
data Array.<number> | Float32Array

keys() → {Array.<string>}

Description:
  • Return keys of all attributes.

Source:
Returns:
Type
Array.<string>

name() → {string}

Description:
  • Return name of the source data.

Source:
Returns:
Type
string

normalized(key) → {boolean}

Description:
  • Return if the attribute data is normalized.

Source:
Parameters:
Name Type Description
key string

Attribute key.

Returns:
Type
boolean

pushBack(vertexData)

Description:
  • Virtual function to insert new vertex data at the end.

Source:
Parameters:
Name Type Description
vertexData number | Array

setData(data)

Description:
  • Set data for this source.

Source:
Parameters:
Name Type Description
data Array | Float32Array