Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Mesh

Index

Constructors

constructor

Properties

bufferUsage

bufferUsage: number = WebGLRenderingContext.DYNAMIC_DRAW

buffers

buffers: Record<string, WebGLBuffer> = {}

geometry

geometry: BufferGeometry

gl

gl: null | WebGLRenderingContext = null

material

material: Material

program

program: null | WebGLProgram = null

Methods

Private compileShader

  • compileShader(type: number, code: string): null | WebGLShader
  • Parameters

    • type: number
    • code: string

    Returns null | WebGLShader

Private createBuffers

  • createBuffers(): Mesh

Private createProgram

  • createProgram(vertexShader: string, fragmentShader: string): WebGLProgram
  • Parameters

    • vertexShader: string
    • fragmentShader: string

    Returns WebGLProgram

Private deleteBuffers

  • deleteBuffers(): Mesh

disableAttribs

  • disableAttribs(): Mesh

dispose

  • dispose(): void
  • Free attributes, buffers and delete the program and disconnect the mesh from the WebGL context

    Returns void

draw

enableAttribs

  • enableAttribs(): Mesh

init

  • init(gl: WebGLRenderingContext): void
  • Initialize this mesh inside a WebGLRenderingContext, does nothing if already initialized.

    Parameters

    • gl: WebGLRenderingContext

      the WebGLRenderingContext

    Returns void

recompile

setUniforms

updateBuffer

  • updateBuffer(attribName: string, newData: Float32Array, offset?: number, syncGeometry?: boolean): Mesh
  • Update buffer of a single attribute

    Parameters

    • attribName: string

      name of the attribute to be updated

    • newData: Float32Array

      the new data

    • offset: number = 0

      offset (default = 0)

    • syncGeometry: boolean = true

      also keep the underlying geometry data in sync (default = true)

    Returns Mesh

    current instance

updateBuffers

  • updateBuffers(): Mesh

Generated using TypeDoc