CLASSES
TagsA - Z

VertexBuffer

Description

class VertexBuffer

Creates a new VertexBuffer. Methods of VertexBuffer interface are used to manipulate vertex buffer resources

Constructor

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

Parameters

Name Type Description
engine any @param engine
data number[] or Float32Array or Buffer VertexData into buffer
kind string The kind of vertex buffer (defined as static variables in VertexBuffer class)
updatable boolean True if the vertex buffer should be dynamic, false otherwise.
optional postponeInternalCreation boolean @param postponeInternalCreation
optional stride number
optional instanced boolean
optional offset number

Members

Float32Array : ()

static PositionKind : string

The position kind

static NormalKind : string

The normal kind

static TangentKind : string

static UVKind : string

The UV kind

static UV2Kind : string

The UV2 kind

static UV3Kind : string

static UV4Kind : string

static UV5Kind : string

static UV6Kind : string

static ColorKind : string

The color kind

static MatricesIndicesKind : string

The matrice indice kind

static MatricesWeightsKind : string

The matrice weight kind

static MatricesIndicesExtraKind : string

static MatricesWeightsExtraKind : string

Methods

getKind() → string

Returns the kind of the VertexBuffer (string).

isUpdatable() → boolean

Boolean : is the VertexBuffer updatable ?

getData() → number[]

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

getBuffer() → 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 ?

create(data, Float32Array) → void

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

Returns the created WebGLBuffer.

Parameters

Name Type Description
optional data number[] or Float32Array VertexData into buffer

update(data, Float32Array) → void

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

Returns the updated WebGLBuffer.

Parameters

Name Type Description
data number[] or Float32Array VertexData into buffer

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 VertexData into buffer
offset number

dispose() → void

Disposes the VertexBuffer and the underlying WebGLBuffer.