2
0
Эх сурвалжийг харах

Refactored cameraHelper.update(camera) to cameraHelper.update()

zz85 13 жил өмнө
parent
commit
98cb0d37e5

+ 2 - 2
examples/webgl_camera.html

@@ -224,7 +224,7 @@
 					cameraPerspective.far = mesh.position.length();
 					cameraPerspective.updateProjectionMatrix();
 
-					cameraPerspectiveHelper.update( cameraPerspective );
+					cameraPerspectiveHelper.update();
 					cameraPerspectiveHelper.lines.visible = true;
 
 					cameraOrthoHelper.lines.visible = false;
@@ -234,7 +234,7 @@
 					cameraOrtho.far = mesh.position.length();
 					cameraOrtho.updateProjectionMatrix();
 
-					cameraOrthoHelper.update( cameraOrtho );
+					cameraOrthoHelper.update();
 					cameraOrthoHelper.lines.visible = true;
 
 					cameraPerspectiveHelper.lines.visible = false;

+ 2 - 4
src/extras/helpers/CameraHelper.js

@@ -102,11 +102,9 @@ THREE.CameraHelper = function ( camera ) {
 THREE.CameraHelper.prototype = new THREE.Object3D();
 THREE.CameraHelper.prototype.constructor = THREE.CameraHelper;
 
-THREE.CameraHelper.prototype.update = function ( camera ) {
+THREE.CameraHelper.prototype.update = function () {
 
-	if (camera === undefined) {
-		camera = this.camera;
-	}
+	var camera = this.camera;
 
 	var w = 1;
 	var h = 1;

+ 1 - 1
src/extras/renderers/plugins/ShadowMapPlugin.js

@@ -179,7 +179,7 @@ THREE.ShadowMapPlugin = function ( ) {
 			shadowCamera.matrixWorldInverse.getInverse( shadowCamera.matrixWorld );
 
 			if ( light.cameraHelper ) light.cameraHelper.lines.visible = light.shadowCameraVisible;
-			if ( light.shadowCameraVisible ) light.cameraHelper.update( light.shadowCamera );
+			if ( light.shadowCameraVisible ) light.cameraHelper.update();
 
 			// compute shadow matrix