diff --git a/examples/js/materials/nodes/accessors/CameraNode.js b/examples/js/materials/nodes/accessors/CameraNode.js index fa7b042002d35cc8743fdcdb3125e164653c8803..e02e3fc24ad1babe49cfc99313b469ae6661f6c3 100644 --- a/examples/js/materials/nodes/accessors/CameraNode.js +++ b/examples/js/materials/nodes/accessors/CameraNode.js @@ -7,9 +7,7 @@ THREE.CameraNode = function( scope, camera ) { THREE.TempNode.call( this, 'v3' ); this.setScope( scope || THREE.CameraNode.POSITION ); - this.camera = camera; - - this.requestUpdate = this.camera !== undefined; + this.setCamera( camera ); }; @@ -19,6 +17,13 @@ THREE.CameraNode.prototype.constructor = THREE.CameraNode; THREE.CameraNode.POSITION = 'position'; THREE.CameraNode.DEPTH = 'depth'; +THREE.CameraNode.prototype.setCamera = function( camera ) { + + this.camera = camera; + this.requestUpdate = camera !== undefined; + +}; + THREE.CameraNode.prototype.setScope = function( scope ) { switch ( this.scope ) {