Browse Source

improved CameraHelper such that it does require to pass camera via .update(camera) if camera is already defined in the object's constructor

zz85 13 years ago
parent
commit
2f3a71940d
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/extras/helpers/CameraHelper.js

+ 6 - 0
src/extras/helpers/CameraHelper.js

@@ -73,6 +73,8 @@ THREE.CameraHelper = function ( camera ) {
 	addLine( "cf1", "cf2", hexCross );
 	addLine( "cf3", "cf4", hexCross );
 
+	this.camera = camera;
+
 	function addLine( a, b, hex ) {
 
 		addPoint( a, hex );
@@ -102,6 +104,10 @@ THREE.CameraHelper.prototype.constructor = THREE.CameraHelper;
 
 THREE.CameraHelper.prototype.update = function ( camera ) {
 
+	if (camera !== undefined) {
+		camera = this.camera;
+	}
+
 	var w = 1;
 	var h = 1;