VertexBuffer

Description

class VertexBuffer

Constructor

new VertexBuffer(engine, data, Buffer, kind, updatable, postponeInternalCreation, stride, instanced, offset, size)

Parameters

Name Type Description
engine any
data FloatArray or Buffer
kind string
updatable boolean
optional postponeInternalCreation boolean
optional stride number
optional instanced boolean
optional offset number

Members

static PositionKind : string

static NormalKind : string

static TangentKind : string

static UVKind : string

static UV2Kind : string

static UV3Kind : string

static UV4Kind : string

static UV5Kind : string

static UV6Kind : string

static ColorKind : string

static MatricesIndicesKind : string

static MatricesWeightsKind : string

static MatricesIndicesExtraKind : string

static MatricesWeightsExtraKind : string

Methods

getKind() string

Returns the kind of the VertexBuffer (string).

isUpdatable() boolean

Boolean : is the VertexBuffer updatable ?

getData() Nullable<FloatArray>

Returns an array of numbers or a Float32Array containing the VertexBuffer data.

getBuffer() Nullable<WebGLBuffer>

Returns the WebGLBuffer associated to the VertexBuffer.

getStrideSize() number

Returns the stride of the VertexBuffer (integer).

getOffset() number

Returns the offset (integer).

getSize() number

Returns the VertexBuffer total size (integer).

getIsInstanced() boolean

Boolean : is the WebGLBuffer of the VertexBuffer instanced now ?

getInstanceDivisor() number

Returns the instancing divisor, zero for non-instanced (integer).

create(data) void

Creates the underlying WebGLBuffer from the passed numeric array or Float32Array.

Returns the created WebGLBuffer.

Parameters

Name Type Description
optional data FloatArray

update(data) void

Updates the underlying WebGLBuffer according to the passed numeric array or Float32Array.

Returns the updated WebGLBuffer.

Parameters

Name Type Description
data FloatArray

updateDirectly(data, offset) void

Updates directly the underlying WebGLBuffer according to the passed numeric array or Float32Array.

Returns the directly updated WebGLBuffer.

Parameters

Name Type Description
data Float32Array
offset number

dispose() void

Disposes the VertexBuffer and the underlying WebGLBuffer.