preact
This commit is contained in:
parent
6acf267d48
commit
b7614eb3f8
4794 changed files with 1280808 additions and 1546 deletions
37
frontend/node_modules/three/examples/jsm/nodes/code/ExpressionNode.js
generated
vendored
Normal file
37
frontend/node_modules/three/examples/jsm/nodes/code/ExpressionNode.js
generated
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
import Node, { addNodeClass } from '../core/Node.js';
|
||||
import { nodeProxy } from '../shadernode/ShaderNode.js';
|
||||
|
||||
class ExpressionNode extends Node {
|
||||
|
||||
constructor( snippet = '', nodeType = 'void' ) {
|
||||
|
||||
super( nodeType );
|
||||
|
||||
this.snippet = snippet;
|
||||
|
||||
}
|
||||
|
||||
generate( builder, output ) {
|
||||
|
||||
const type = this.getNodeType( builder );
|
||||
const snippet = this.snippet;
|
||||
|
||||
if ( type === 'void' ) {
|
||||
|
||||
builder.addLineFlowCode( snippet );
|
||||
|
||||
} else {
|
||||
|
||||
return builder.format( `( ${ snippet } )`, type, output );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default ExpressionNode;
|
||||
|
||||
export const expression = nodeProxy( ExpressionNode );
|
||||
|
||||
addNodeClass( 'ExpressionNode', ExpressionNode );
|
||||
Loading…
Add table
Add a link
Reference in a new issue