From 99e2e4e6901c05e6a779522ec7f5eb8740ea2d37 Mon Sep 17 00:00:00 2001 From: SUNAG Date: Fri, 11 Dec 2015 10:07:32 -0200 Subject: [PATCH] set camera by function --- examples/js/materials/nodes/accessors/CameraNode.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/js/materials/nodes/accessors/CameraNode.js b/examples/js/materials/nodes/accessors/CameraNode.js index fa7b042002..e02e3fc24a 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 ) { -- GitLab