-
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 |
---|---|---|---|
className
|
String | GeometryData |
类名 |
isGeometryData
|
Boolean | true |
isGeometryData |
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
-
getByteLength(){number}
-
获取数据大小,单位为字节
Returns:
Type Description number 数据大小 -
setSubData(offset, data)
-
更新部分数据
Name Type Description offset
Number 偏移index
data
TypedArray 数据
-
clearSubData()
-
清除 subData
-
clone(){GeometryData}
-
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 -
Get the value by index. Please note that it will return the same reference for performance reasons. If you want to get a copy, use #getCopy instead.
Name Type Description index
Number Returns:
Type Description Number | Vector2 | Vector3 | Vector4 -
Get the value by index. It will return a copy of value.
Name Type Description index
Number Returns:
Type Description 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){Boolean}
-
按 index 遍历
Name Type Description callback
GeometryDataTraverseCallback Returns:
Type Description Boolean -
traverseByComponent(callback){Boolean}
-
按 Component 遍历 Component
Name Type Description callback
GeometryDataTraverseByComponentCallback Returns:
Type Description Boolean