Selaa lähdekoodia

Removed redundant matrixWorldInverse updates.

Mr.doob 8 vuotta sitten
vanhempi
commit
6cc82c7a50

+ 0 - 1
examples/js/Mirror.js

@@ -143,7 +143,6 @@ THREE.Mirror = function ( width, height, options ) {
 
 		mirrorCamera.updateProjectionMatrix();
 		mirrorCamera.updateMatrixWorld();
-		mirrorCamera.matrixWorldInverse.getInverse( mirrorCamera.matrixWorld );
 
 		// Update the texture matrix
 		textureMatrix.set(

+ 0 - 1
examples/js/WaterShader.js

@@ -279,7 +279,6 @@ THREE.Water.prototype.updateTextureMatrix = function () {
 
 	this.mirrorCamera.updateProjectionMatrix();
 	this.mirrorCamera.updateMatrixWorld();
-	this.mirrorCamera.matrixWorldInverse.getInverse( this.mirrorCamera.matrixWorld );
 
 	// Update the texture matrix
 	this.textureMatrix.set(

+ 1 - 3
examples/js/renderers/CSS2DRenderer.js

@@ -92,9 +92,7 @@ THREE.CSS2DRenderer = function () {
 
 		if ( camera.parent === null ) camera.updateMatrixWorld();
 
-		camera.matrixWorldInverse.getInverse( camera.matrixWorld );
-
-		viewMatrix.copy( camera.matrixWorldInverse.getInverse( camera.matrixWorld ) );
+		viewMatrix.copy( camera.matrixWorldInverse );
 		viewProjectionMatrix.multiplyMatrices( camera.projectionMatrix, viewMatrix );
 
 		renderObject( scene, camera );

+ 0 - 2
examples/js/renderers/CSS3DRenderer.js

@@ -277,8 +277,6 @@ THREE.CSS3DRenderer = function () {
 
 		if ( camera.parent === null ) camera.updateMatrixWorld();
 
-		camera.matrixWorldInverse.getInverse( camera.matrixWorld );
-
 		var cameraCSSMatrix = 'translateZ(' + fov + 'px)' +
 			getCameraCSSMatrix( camera.matrixWorldInverse );
 

+ 1 - 1
examples/js/renderers/Projector.js

@@ -403,7 +403,7 @@ THREE.Projector = function () {
 		if ( scene.autoUpdate === true ) scene.updateMatrixWorld();
 		if ( camera.parent === null ) camera.updateMatrixWorld();
 
-		_viewMatrix.copy( camera.matrixWorldInverse.getInverse( camera.matrixWorld ) );
+		_viewMatrix.copy( camera.matrixWorldInverse );
 		_viewProjectionMatrix.multiplyMatrices( camera.projectionMatrix, _viewMatrix );
 
 		_frustum.setFromMatrix( _viewProjectionMatrix );

+ 0 - 1
examples/js/renderers/RaytracingWorker.js

@@ -514,7 +514,6 @@ THREE.RaytracingRendererWorker = function () {
 
 		if ( camera.parent === null ) camera.updateMatrixWorld();
 
-		camera.matrixWorldInverse.getInverse( camera.matrixWorld );
 		cameraPosition.setFromMatrixPosition( camera.matrixWorld );
 
 		//

+ 1 - 1
examples/js/renderers/SVGRenderer.js

@@ -173,7 +173,7 @@ THREE.SVGRenderer = function () {
 		_this.info.render.vertices = 0;
 		_this.info.render.faces = 0;
 
-		_viewMatrix.copy( camera.matrixWorldInverse.getInverse( camera.matrixWorld ) );
+		_viewMatrix.copy( camera.matrixWorldInverse );
 		_viewProjectionMatrix.multiplyMatrices( camera.projectionMatrix, _viewMatrix );
 
 		_renderData = _projector.projectScene( scene, camera, this.sortObjects, this.sortElements );

+ 0 - 2
examples/webgl_nearestneighbour.html

@@ -206,8 +206,6 @@
 				var _frustum = new THREE.Frustum();
 				var _projScreenMatrix = new THREE.Matrix4();
 
-				camera.matrixWorldInverse.getInverse( camera.matrixWorld );
-
 				_projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );
 				_frustum.setFromMatrix( _projScreenMatrix );
 

+ 1 - 3
src/extras/SceneUtils.js

@@ -32,9 +32,7 @@ var SceneUtils = {
 
 	attach: function ( child, scene, parent ) {
 
-		var matrixWorldInverse = new Matrix4();
-		matrixWorldInverse.getInverse( parent.matrixWorld );
-		child.applyMatrix( matrixWorldInverse );
+		child.applyMatrix( new Matrix4().getInverse( parent.matrixWorld ) );
 
 		scene.remove( child );
 		parent.add( child );

+ 0 - 2
src/renderers/WebGLRenderer.js

@@ -1101,8 +1101,6 @@ function WebGLRenderer( parameters ) {
 
 		if ( camera.parent === null ) camera.updateMatrixWorld();
 
-		camera.matrixWorldInverse.getInverse( camera.matrixWorld );
-
 		_projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );
 		_frustum.setFromMatrix( _projScreenMatrix );
 

+ 0 - 2
src/renderers/webgl/WebGLShadowMap.js

@@ -215,7 +215,6 @@ function WebGLShadowMap( _renderer, _lights, _objects, capabilities ) {
 				_lookTarget.setFromMatrixPosition( light.target.matrixWorld );
 				shadowCamera.lookAt( _lookTarget );
 				shadowCamera.updateMatrixWorld();
-				shadowCamera.matrixWorldInverse.getInverse( shadowCamera.matrixWorld );
 
 				// compute shadow matrix
 
@@ -246,7 +245,6 @@ function WebGLShadowMap( _renderer, _lights, _objects, capabilities ) {
 					shadowCamera.up.copy( cubeUps[ face ] );
 					shadowCamera.lookAt( _lookTarget );
 					shadowCamera.updateMatrixWorld();
-					shadowCamera.matrixWorldInverse.getInverse( shadowCamera.matrixWorld );
 
 					var vpDimensions = cube2DViewPorts[ face ];
 					_state.viewport( vpDimensions );