ResolutionNode.js 567 B

1234567891011121314151617181920212223242526
  1. /**
  2. * @author sunag / http://www.sunag.com.br/
  3. */
  4. THREE.ResolutionNode = function( renderer ) {
  5. THREE.Vector2Node.call( this );
  6. this.requestUpdate = true;
  7. this.renderer = renderer;
  8. };
  9. THREE.ResolutionNode.prototype = Object.create( THREE.Vector2Node.prototype );
  10. THREE.ResolutionNode.prototype.constructor = THREE.ResolutionNode;
  11. THREE.ResolutionNode.prototype.updateFrame = function( delta ) {
  12. var size = this.renderer.getSize(),
  13. pixelRatio = this.renderer.getPixelRatio();
  14. this.x = size.width * pixelRatio;
  15. this.y = size.height * pixelRatio;
  16. };