2
0

NodeBuilderState.js 821 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. class NodeBuilderState {
  2. constructor( vertexShader, fragmentShader, computeShader, nodeAttributes, bindings, updateNodes, updateBeforeNodes, transforms = [] ) {
  3. this.vertexShader = vertexShader;
  4. this.fragmentShader = fragmentShader;
  5. this.computeShader = computeShader;
  6. this.transforms = transforms;
  7. this.nodeAttributes = nodeAttributes;
  8. this.bindings = bindings;
  9. this.updateNodes = updateNodes;
  10. this.updateBeforeNodes = updateBeforeNodes;
  11. this.usedTimes = 0;
  12. }
  13. createBindings() {
  14. const bindingsArray = [];
  15. for ( const instanceBinding of this.bindings ) {
  16. let binding = instanceBinding;
  17. if ( instanceBinding.shared !== true ) {
  18. binding = instanceBinding.clone();
  19. }
  20. bindingsArray.push( binding );
  21. }
  22. return bindingsArray;
  23. }
  24. }
  25. export default NodeBuilderState;