VarNode.js 565 B

1234567891011121314151617181920212223242526
  1. /**
  2. * @author sunag / http://www.sunag.com.br/
  3. */
  4. THREE.VarNode = function( type ) {
  5. THREE.GLNode.call( this, type );
  6. };
  7. THREE.VarNode.prototype = Object.create( THREE.GLNode.prototype );
  8. THREE.VarNode.prototype.constructor = THREE.VarNode;
  9. THREE.VarNode.prototype.getType = function( builder ) {
  10. return builder.getTypeByFormat( this.type );
  11. };
  12. THREE.VarNode.prototype.generate = function( builder, output ) {
  13. var varying = builder.material.getVar( this.uuid, this.type );
  14. return builder.format( varying.name, this.getType( builder ), output );
  15. };