Options
All
  • Public
  • Public/Protected
  • All
Menu

Mesh class for holding the geometry, program and shaders for an object.

Hierarchy

Index

Constructors

constructor

Properties

Private #geometry

#geometry: Geometry

Private #gl

#gl: WebGLRenderingContext

children

children: SceneObject[] = ...

drawMode

drawMode: number = ...

DrawMode

default

gl.TRIANGLES

Protected hasIndices

hasIndices: boolean

modelMatrix

modelMatrix: mat4 = ...

normalMatrix

normalMatrix: mat4 = ...

parentNode

parentNode: null | SceneObject = null

position

position: vec3 = ...

program

program: Program

Protected renderable

renderable: boolean = false

rotation

rotation: vec3 = ...

scale

scale: vec3 = ...

shouldUpdate

shouldUpdate: boolean = true

vao

vao: WebGLVertexArrayObjectOES

Protected vaoExtension

vaoExtension: OES_vertex_array_objectInterface

worldMatrix

worldMatrix: mat4 = ...

Methods

copyFromMatrix

  • copyFromMatrix(matrix: ReadonlyMat4): Mesh

delete

  • delete(): void
  • Deletes the geometry, program and VAO extension associated with the Mesh

    Returns void

draw

setCamera

setParent

setPosition

  • setPosition(position: { x?: undefined | number; y?: undefined | number; z?: undefined | number }): Mesh
  • Parameters

    • position: { x?: undefined | number; y?: undefined | number; z?: undefined | number }
      • Optional x?: undefined | number
      • Optional y?: undefined | number
      • Optional z?: undefined | number

    Returns Mesh

setRotation

  • setRotation(rotation: { x?: undefined | number; y?: undefined | number; z?: undefined | number }): Mesh
  • Sets rotation

    Parameters

    • rotation: { x?: undefined | number; y?: undefined | number; z?: undefined | number }
      • Optional x?: undefined | number
      • Optional y?: undefined | number
      • Optional z?: undefined | number

    Returns Mesh

setScale

  • setScale(scale: { x?: undefined | number; y?: undefined | number; z?: undefined | number }): Mesh
  • Sets scale

    Parameters

    • scale: { x?: undefined | number; y?: undefined | number; z?: undefined | number }
      • Optional x?: undefined | number
      • Optional y?: undefined | number
      • Optional z?: undefined | number

    Returns Mesh

setUniform

  • setUniform(uniformName: string, uniformType: UniformType, uniformValue: unknown): Mesh
  • Set uniform value. Query the uniform location if necessary and cache it in-memory for future use

    Parameters

    • uniformName: string
    • uniformType: UniformType
    • uniformValue: unknown

    Returns Mesh

traverseGraph

  • traverseGraph(callback: any, node?: SceneObject): this

updateGeometryAttribute

  • updateGeometryAttribute(key: string, index: number, size: number, subTypeArray: Float32Array): Mesh
  • Parameters

    • key: string

      Name of attribute. Must match attribute name in your GLSL program

    • index: number

      Index to start updating your typed array from

    • size: number

      How many items are to be updated

    • subTypeArray: Float32Array

      The whole or partial array to update your attribute with

    Returns Mesh

updateModelMatrix

  • updateModelMatrix(): Mesh

updateWorldMatrix

  • updateWorldMatrix(parentWorldMatrix?: null | Float32Array | readonly number[]): this

use

Generated using TypeDoc