Buffer

The Buffer contain the data that is used for the geometry of 3D models, animations, and skinning.

Constructor

new Buffer(array, stride)

Parameters:
NameTypeDescription
arrayTypedArray
  • A typed array with a shared buffer. Stores the geometry data.
stridenumber
  • The number of typed-array elements per vertex.

Members

array :TypedArray

A typed array with a shared buffer. Stores the geometry data.

Type:
  • TypedArray

count :number

Gives the total number of elements in the array.

Type:
  • number

stride :number

The number of typed-array elements per vertex.

Type:
  • number

updateRange :object

Object containing offset and count.

Type:
  • object
Default Value
  • { offset: 0, count: - 1 }

usage :BUFFER_USAGE

Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the usage parameter of WebGLRenderingContext.bufferData().

Default Value
  • BUFFER_USAGE.STATIC_DRAW

version :number

A version number, incremented every time the data is changed.

Type:
  • number
Default Value
  • 0

Methods

clone() → {Buffer}

Return a copy of this buffer.

Returns:
Type: 
Buffer

copy(source) → {Buffer}

Copies another Buffer to this Buffer.

Parameters:
NameTypeDescription
sourceBuffer

The buffer to be copied.

Returns:
Type: 
Buffer

onUploadCallback()

A callback function that is executed after the Renderer has transferred the attribute array data to the GPU.