Shape

Hierarchy

Implements

Constructors

new Shape(context: Context): Shape

Properties

attributes: ObjectMap<object>

The vertex attributes of this Shape.

context: Context

indexBuffer: WebGLBuffer

The WebGL index buffer for this Shape.

indices: number[] = []

The indices of each triangles of this Shape.

needsUpdate: boolean = true

Whether the buffer of this Shape should be updated. Set it to true after this shape is changed.

positions: Vec2[] = []

shader: Shader

The shader class of this Shape.

texCoords: Vec2[] = []

transform: Transform = new Transform()

The transform of this Shape.

uniforms: ObjectMap<UniformValue>

The uniform values passed to the shader.

usage: ShapeUsage = "dynamic"

The usage hint of this Shape.

vertexBuffer: WebGLBuffer

The WebGL vertex buffer for this Shape.

Methods

attributeStride(): number

dispose(): void

draw(transform: Transform): void

setFloatAttributes(name: string, attributes: number[]): void

setVec2Attributes(name: string, attributes: Vec2[]): void

update(): void

updateIfNeeded(): void