فهرست منبع

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;