t3d. 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 :t3d.BUFFER_USAGE

Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the usage parameter of WebGLRenderingContext.bufferData().
Default Value
  • t3d.BUFFER_USAGE.STATIC_DRAW

version :Number

A version number, incremented every time the data is changed.
Type:
  • Number
Default Value
  • 0

Methods

clone() → {t3d.Buffer}

Return a copy of this buffer.
Returns:
Type: 
t3d.Buffer

copy(source) → {t3d.Buffer}

Copies another Buffer to this Buffer.
Parameters:
NameTypeDescription
sourcet3d.BufferThe buffer to be copied.
Returns:
Type: 
t3d.Buffer

onUploadCallback()

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