Преглед изворни кода

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 година
родитељ
комит
2f3a71940d
1 измењених фајлова са 6 додато и 0 уклоњено
  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;