Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Mesh
    • InstancedMesh

Index

Constructors

constructor

  • new InstancedMesh(gl: WebGLRenderingContext, __namedParameters: InstancedMeshInterface): InstancedMesh

Properties

Private #geometry

#geometry: Geometry

Private #geometry

#geometry: Geometry

Private #gl

#gl: WebGLRenderingContext

Private #gl

#gl: WebGLRenderingContext

Private #instanceExtension

#instanceExtension: any

children

children: SceneObject[] = ...

drawMode

drawMode: number = ...

DrawMode

default

gl.TRIANGLES

Protected hasIndices

hasIndices: boolean

instanceCount

instanceCount: number

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

delete

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

    Returns void

draw

setCamera

setMatrixAt

  • setMatrixAt(index: number, matrix: Float32Array): InstancedMesh
  • Parameters

    • index: number

      Instance index on which to apply the matrix

    • matrix: Float32Array

      Matrix to control the instance scale, rotation and translation

    Returns InstancedMesh

setParent

setPosition

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

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

    Returns InstancedMesh

setRotation

  • setRotation(rotation: { x?: undefined | number; y?: undefined | number; z?: undefined | number }): InstancedMesh
  • 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 InstancedMesh

setScale

  • setScale(scale: { x?: undefined | number; y?: undefined | number; z?: undefined | number }): InstancedMesh
  • 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 InstancedMesh

setUniform

traverseGraph

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

updateGeometryAttribute

  • updateGeometryAttribute(key: string, index: number, size: number, subTypeArray: Float32Array): InstancedMesh
  • 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 InstancedMesh

updateModelMatrix

updateWorldMatrix

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

use

Generated using TypeDoc