Capítulo 394 de 859

Chapter 394: CodeNode

Core Idea

This class represents native code sections. It is the base class for modules like FunctionNode which allows to implement functions with native shader languages.

Key Concepts

  • code : string: The native code.
  • global : boolean: This flag is used for global cache.
  • includes : Array.<Node>: An array of includes
  • isCodeNode : boolean (readonly): This flag can be used for type testing.
  • language : 'js' | 'wgsl' | 'glsl': The used language.

Reference Tables

Constructor

Signature
`new CodeNode( code : string, includes : Array.<Node>, language : 'js'

Properties

PropertyDescription
.code : stringThe native code.
.global : booleanThis flag is used for global cache.
.includes : Array.<Node>An array of includes
.isCodeNode : boolean (readonly)This flag can be used for type testing.
`.language : 'js''wgsl'

Methods

MethodDescription
.getIncludes( builder : NodeBuilder ) : Array.<Node>Returns the includes of this code node.
.setIncludes( includes : Array.<Node> ) : CodeNodeSets the includes of this code node.

Key Takeaways

  1. CodeNode extends: EventDispatcher → Node
  2. Most relevant properties: code, global, includes, isCodeNode.
  3. Key methods: getIncludes, setIncludes.

Connects To