Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Mesh3D<EventTypes>

Represents a mesh which contains geometry and has a material.

Type parameters

  • EventTypes: string | symbol

Hierarchy

Index

Constructors

constructor

  • Creates a new mesh with the specified geometry and material.

    Parameters

    • geometry: MeshGeometry3D

      The geometry for the mesh.

    • Optional material: Material

      The material for the mesh. If the material is empty the mesh won't be rendered.

    Returns Mesh3D

Properties

Private _instances

_instances: InstancedMesh3D[] = []

enabledRenderPasses

enabledRenderPasses: string[] = ["material"]

The enabled render passes for this mesh.

geometry

geometry: MeshGeometry3D

The geometry for the mesh.

Optional material

material: Material

The material for the mesh. If the material is empty the mesh won't be rendered.

Optional morphWeights

morphWeights: number[]

Array of weights used for morphing between geometry targets.

pluginName

pluginName: string = "pipeline"

The name of the plugin used for rendering the mesh.

Optional skin

skin: Skin

The skin used for vertex skinning.

transform

transform: Transform3D = new Transform3D()

Static prefixed

prefixed: string | boolean

Accessors

instances

  • get instances(): InstancedMesh3D[]
  • An array of instances created from this mesh.

    Returns InstancedMesh3D[]

localTransform

position

rotationQuaternion

scale

worldTransform

z

  • get z(): number
  • set z(value: number): void
  • The position of the object on the z axis relative to the local coordinates of the parent.

    Returns number

  • The position of the object on the z axis relative to the local coordinates of the parent.

    Parameters

    • value: number

    Returns void

Methods

_render

  • _render(renderer: Renderer): void

addListener

  • addListener(event: EventTypes, fn: ListenerFn, context?: any): this
  • Parameters

    • event: EventTypes
    • fn: ListenerFn
    • Optional context: any

    Returns this

createInstance

  • createInstance(): InstancedMesh3D

destroy

  • destroy(): void

disableRenderPass

  • disableRenderPass(name: string): void
  • Disables the render pass with the specified name.

    Parameters

    • name: string

      The name of the render pass to disable.

    Returns void

emit

  • emit(event: EventTypes, ...args: Array<any>): boolean
  • Calls each of the listeners registered for a given event.

    Parameters

    • event: EventTypes
    • Rest ...args: Array<any>

    Returns boolean

enableRenderPass

  • enableRenderPass(name: string): void
  • Enables the render pass with the specified name.

    Parameters

    • name: string

      The name of the render pass to enable.

    Returns void

eventNames

  • eventNames(): Array<EventTypes>
  • Return an array listing the events for which the emitter has registered listeners.

    Returns Array<EventTypes>

isRenderPassEnabled

  • isRenderPassEnabled(name: string): boolean
  • Returns a value indicating if the specified render pass is enabled.

    Parameters

    • name: string

      The name of the render pass to check.

    Returns boolean

listenerCount

  • listenerCount(event: EventTypes): number
  • Return the number of listeners listening to a given event.

    Parameters

    • event: EventTypes

    Returns number

listeners

  • Return the listeners registered for a given event.

    Parameters

    • event: EventTypes

    Returns Array<ListenerFn>

off

  • off(event: EventTypes, fn?: EventEmitter.ListenerFn, context?: any, once?: undefined | false | true): this
  • Parameters

    • event: EventTypes
    • Optional fn: EventEmitter.ListenerFn
    • Optional context: any
    • Optional once: undefined | false | true

    Returns this

on

  • on(event: EventTypes, fn: ListenerFn, context?: any): this
  • Add a listener for a given event.

    Parameters

    • event: EventTypes
    • fn: ListenerFn
    • Optional context: any

    Returns this

once

  • once(event: EventTypes, fn: ListenerFn, context?: any): this
  • Add a one-time listener for a given event.

    Parameters

    • event: EventTypes
    • fn: ListenerFn
    • Optional context: any

    Returns this

removeAllListeners

  • Remove all listeners, or those of the specified event.

    Parameters

    Returns this

removeInstance

  • removeInstance(instance: InstancedMesh3D): void
  • Removes a instanced mesh from this mesh.

    Parameters

    • instance: InstancedMesh3D

      The instance to remove.

    Returns void

removeListener

  • removeListener(event: EventTypes, fn?: EventEmitter.ListenerFn, context?: any, once?: undefined | false | true): this
  • Remove the listeners of a given event.

    Parameters

    • event: EventTypes
    • Optional fn: EventEmitter.ListenerFn
    • Optional context: any
    • Optional once: undefined | false | true

    Returns this

Static createCube

  • Creates a new cube (six faces) mesh with the specified material.

    Parameters

    • Default value material: Material = new StandardMaterial()

      The material to use.

    Returns Mesh3D

Static createPlane

  • Creates a new plane (flat square) mesh with the specified material.

    Parameters

    • Default value material: Material = new StandardMaterial()

      The material to use.

    Returns Mesh3D

Static createQuad

  • Creates a new quad (flat square) mesh with the specified material.

    Parameters

    • Default value material: Material = new StandardMaterial()

      The material to use.

    Returns Mesh3D

Static isInstancingSupported

  • isInstancingSupported(renderer: Renderer): boolean
  • Returns a value indicating if specified renderer supports instancing.

    Parameters

    • renderer: Renderer

      The renderer.

    Returns boolean

Generated using TypeDoc