RectShape

Hierarchy

Implements

Constructors

new RectShape(context: Context): RectShape

Properties

attributes: ObjectMap<object>

The vertex attributes of this Shape.

context: Context

indexBuffer: WebGLBuffer

The WebGL index buffer for this Shape.

indices: Array<number> = [0, 1, 2, 1, 2, 3]

needsUpdate: boolean = true

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

positions: [Vec2, Vec2, Vec2, Vec2] = [new Vec2(0, 0), new Vec2(1, 0), new Vec2(0, 1), new Vec2(1, 1)]

rect: Rect = new Rect()

shader: Shader

The shader class of this Shape.

texCoords: [Vec2, Vec2, Vec2, Vec2] = [new Vec2(0, 0), new Vec2(1, 0), new Vec2(0, 1), new Vec2(1, 1)]

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