Class: GeometryData

GeometryData

new GeometryData(data, size, params)

geometry vertex data

Name Type Description
data TypedArray

数据

size Number

The number of components per vertex attribute.Must be 1, 2, 3, or 4.

params Object optional

初始化参数,所有params都会复制到实例上

Members Show Inherited

Name Type Default Description
size Number

The number of components per vertex attribute.Must be 1, 2, 3, or 4.

normalized Boolean false

Whether integer data values should be normalized when being casted to a float.

type GLenum

The data type of each component in the array.

isDirty Boolean false
bufferViewId String
glBuffer Buffer

glBuffer

id string

id

data TypedArray
stride Number this.size

The offset in bytes between the beginning of consecutive vertex attributes.

offset Number 0

An offset in bytes of the first component in the vertex attribute array. Must be a multiple of type.

data TypedArray
length Number
realLength Number
count Number

Methods Show Inherited

clone

Returns:
Type Description
GeometryData

copy(geometryData)

copy

Name Type Description
geometryData GeometryData

getOffset(index){Number}

获取偏移值

Name Type Description
index Number
Returns:
Type Description
Number

获取值

Name Type Description
index Number
Returns:
Type Description
Number | Vector2 | Vector3 | Vector4

set(index, value)

设置值

Name Type Description
index Number
value Number | Vector2 | Vector3 | Vector4

根据 offset 获取值

Name Type Description
offset Number
Returns:
Type Description
Number | Vector2 | Vector3 | Vector4

setByOffset(offset, value)

根据 offset 设置值

Name Type Description
offset Number
value Number | Vector2 | Vector3 | Vector4

traverse(callback(attribute,){Boolean}

按 index 遍历

Name Type Description
callback(attribute, function

index, offset)

Returns:
Type Description
Boolean

traverseByComponent(callback(data,){Boolean}

按 Component 遍历 Component

Name Type Description
callback(data, function

offset)

Returns:
Type Description
Boolean