You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

36 lines
510 B

import Node from './Node.js';
class PropertyNode extends Node {
constructor( name = null, nodeType = 'vec4' ) {
super( nodeType );
this.name = name;
}
getHash( builder ) {
return this.name || super.getHash( builder );
}
generate( builder ) {
const nodeVary = builder.getVarFromNode( this, this.getNodeType( builder ) );
const name = this.name;
if ( name !== null ) {
nodeVary.name = name;
}
return builder.getPropertyName( nodeVary );
}
}
export default PropertyNode;