UVNode.js 363 B

1234567891011121314151617181920212223
  1. import AttributeNode from '../core/AttributeNode.js';
  2. class UVNode extends AttributeNode {
  3. constructor( index = 0 ) {
  4. super( null, 'vec2' );
  5. this.index = index;
  6. Object.defineProperty( this, 'isUVNode', { value: true } );
  7. }
  8. getAttributeName( /*builder*/ ) {
  9. return 'uv' + ( this.index > 0 ? this.index + 1 : '' );
  10. }
  11. }
  12. export default UVNode;