Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AShaderMaterial

Hierarchy

Index

Constructors

constructor

Properties

Protected _eventCallbackDicts

_eventCallbackDicts: {} = {}

Type declaration

_material

_material: Material

Protected _model

Protected _subscriptions

_subscriptions: {} = {}

Type declaration

state

state: {} = {}

Type declaration

  • [name: string]: any

textures

textures: {} = {}

Type declaration

uid

uid: string

uniforms

Static AObjectStateKeys

AObjectStateKeys: string[] = []

Static AObjectVersion

AObjectVersion: number = 1

Static Events

Events: typeof AMaterialEvents = ...

Accessors

ClassConstructor

  • get ClassConstructor(): typeof AObject

model

serializationLabel

  • get serializationLabel(): any

stateSnapshop

  • get stateSnapshop(): {}

threejs

  • get threejs(): ShaderMaterial

Methods

_getEventCallbackDict

_getListeners

  • _getListeners(): {}

activateSubscription

  • activateSubscription(name: string): void

addEventListener

  • addEventListener(eventName: string, callback: (...args: any[]) => void, handle?: string): AEventCallbackSwitch

addEventListeners

  • addEventListeners(eventName: string, callbacks: ((...args: any[]) => void)[], handle?: string): AEventCallbackSwitch

addOneTimeEventListener

  • addOneTimeEventListener(eventName: string, callback: (...args: any[]) => void, handle?: string): AEventCallbackSwitch

addStateKeyListener

  • addStateKeyListener(state_key: string, callback: (self: AObject) => void, handle?: string, synchronous?: boolean): AStateCallbackSwitch
  • Sets a callback function to be called whenever the state specified in state_key changes. The return value callbackSwitch is a callback switch. You can activate the listener with callbackSwitch.activate() and deactive with callbackSwitch.deactivate(). Example Usage:

    var callbackswitch = model.addStateKeyListener('name',()=>{
    n_name_changes = n_name_changes+1;
    })

    Parameters

    • state_key: string

      the name of the state to listen to

    • callback: (self: AObject) => void

      the callback to be executed when state changes

    • Optional handle: string

      the handle / unique identifier for

    • synchronous: boolean = true

      whether callbacks should happen synchronously or allow for batching

    Returns AStateCallbackSwitch

addStateListener

  • addStateListener(callback: (self: AObject) => void, handle?: string, synchronous?: boolean): AStateCallbackSwitch

clearSubscriptions

  • clearSubscriptions(): void

deactivateSubscription

  • deactivateSubscription(name: string): void

dispose

  • dispose(): void

getMaterialGUIParams

  • getMaterialGUIParams(): { MaterialProps: FolderInput<unknown> }

getModelColor

getTexture

  • getTexture(name: string): undefined | ATexture

getUniformValue

  • getUniformValue(name: string): any

getValue

  • getValue(name: string): any

init

loadTexturesFromShaderModel

removeEventListener

  • removeEventListener(eventName: string, handle: string): void

removeListener

  • removeListener(handle: string): void

setModel

setModelColor

  • setModelColor(v: Color | Color): void

setTexture

  • setTexture(name: string, texture?: string | ATexture): void

setUniform

  • setUniform(name: string, value: any, type?: string): void

setUniform3fv

  • setUniform3fv(name: string, value: Vec3): void

setUniform4fv

  • setUniform4fv(name: string, value: Vec4): void

setUniformColor

  • setUniformColor(name: string, value: Color | Color, alpha?: number): void

setUniforms

setUniformsDict

setValue

  • setValue(name: string, value: any): void

setValues

  • setValues(values: MaterialParameters): void

signalEvent

  • signalEvent(eventName: string, ...args: any[]): void

subscribe

toJSON

  • toJSON(): {}

unsubscribe

  • unsubscribe(name: string, errorIfAbsent?: boolean): void

Static CreateWithState

  • CreateWithState(state: {}): AObject

Static SerializationLabel

  • SerializationLabel(): any

Static fromJSON

Generated using TypeDoc