ResolutionNode.js 495 B

12345678910111213141516171819202122232425
  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. this.x = size.width;
  14. this.y = size.height;
  15. };