Skip to content

⬅️ Back to Table of Contents

📄 RendererReferenceNode.js

📊 Analysis Summary

Metric Count
🔧 Functions 2
🧱 Classes 1
📦 Imports 3

📚 Table of Contents

🛠️ File Location:

📂 src/nodes/accessors/RendererReferenceNode.js

📦 Imports

Name Source
ReferenceBaseNode ./ReferenceBaseNode.js
nodeObject ../tsl/TSLCore.js
renderGroup ../core/UniformGroupNode.js

Functions

RendererReferenceNode.updateReference(state: any): any

JSDoc:

/**
     * Updates the reference based on the given state. The state is only evaluated
     * {@link RendererReferenceNode#renderer} is not set.
     *
     * @param {(NodeFrame|NodeBuilder)} state - The current state.
     * @return {Object} The updated reference.
     */

Parameters:

  • state any

Returns: any

Code
updateReference( state ) {

        this.reference = this.renderer !== null ? this.renderer : state.renderer;

        return this.reference;

    }

rendererReference(name: string, type: string, renderer: Renderer): RendererReferenceNode

Parameters:

  • name string
  • type string
  • renderer Renderer

Returns: RendererReferenceNode

Calls:

  • nodeObject (from ../tsl/TSLCore.js)
Code
( name, type, renderer = null ) => nodeObject( new RendererReferenceNode( name, type, renderer ) )

Classes

RendererReferenceNode

Class Code
class RendererReferenceNode extends ReferenceBaseNode {

    static get type() {

        return 'RendererReferenceNode';

    }

    /**
     * Constructs a new renderer reference node.
     *
     * @param {string} property - The name of the property the node refers to.
     * @param {string} inputType - The uniform type that should be used to represent the property value.
     * @param {?Renderer} [renderer=null] - The renderer the property belongs to. When no renderer is set,
     * the node refers to the renderer of the current state.
     */
    constructor( property, inputType, renderer = null ) {

        super( property, inputType, renderer );

        /**
         * The renderer the property belongs to. When no renderer is set,
         * the node refers to the renderer of the current state.
         *
         * @type {?Renderer}
         * @default null
         */
        this.renderer = renderer;

        this.setGroup( renderGroup );

    }

    /**
     * Updates the reference based on the given state. The state is only evaluated
     * {@link RendererReferenceNode#renderer} is not set.
     *
     * @param {(NodeFrame|NodeBuilder)} state - The current state.
     * @return {Object} The updated reference.
     */
    updateReference( state ) {

        this.reference = this.renderer !== null ? this.renderer : state.renderer;

        return this.reference;

    }

}

Methods

updateReference(state: any): any
Code
updateReference( state ) {

        this.reference = this.renderer !== null ? this.renderer : state.renderer;

        return this.reference;

    }