Constructor
new GLBufferAttribute( buffer : WebGLBuffer, type : number, itemSize : number, elementSize : number, count : number, normalized : boolean )
Constructs a new GL buffer attribute.
| buffer |
The native WebGL buffer. |
| type |
The native data type (e.g. |
| itemSize |
The item size. |
| elementSize |
The corresponding size (in bytes) for the given |
| count |
The expected number of vertices in VBO. |
| normalized |
Whether the data are normalized or not. Default is |
Properties
.buffer : WebGLBuffer
The native WebGL buffer.
.count : number
The expected number of vertices in VBO.
.elementSize : number
The corresponding size (in bytes) for the given type parameter.
.isGLBufferAttribute : boolean (readonly)
This flag can be used for type testing.
Default is true.
.itemSize : number
The item size, see BufferAttribute#itemSize.
.name : string
The name of the buffer attribute.
.needsUpdate : number
Flag to indicate that this attribute has changed and should be re-sent to
the GPU. Set this to true when you modify the value of the array.
Default is false.
.normalized : boolean
Applies to integer data only. Indicates how the underlying data in the buffer maps to
the values in the GLSL code. For instance, if buffer contains data of gl.UNSIGNED_SHORT,
and normalized is true, the values 0 - +65535 in the buffer data will be mapped to
0.0f - +1.0f in the GLSL attribute. If normalized is false, the values will be converted
to floats unmodified, i.e. 65535 becomes 65535.0f.
.type : number
The native data type.
.version : number
A version number, incremented every time the needsUpdate is set to true.
Methods
.setBuffer( buffer : WebGLBuffer ) : BufferAttribute
Sets the given native WebGL buffer.
| buffer |
The buffer to set. |
- Returns: A reference to this instance.
.setCount( count : number ) : BufferAttribute
Sets the count (the expected number of vertices in VBO).
| count |
The count. |
- Returns: A reference to this instance.
.setItemSize( itemSize : number ) : BufferAttribute
Sets the item size.
| itemSize |
The item size. |
- Returns: A reference to this instance.
.setType( type : number, elementSize : number ) : BufferAttribute
Sets the given native data type and element size.
| type |
The native data type (e.g. |
| elementSize |
The corresponding size (in bytes) for the given |
- Returns: A reference to this instance.