Browse Source

Mirror: Inlined updateTextureMatrix() in onBeforeRender().

Mr.doob 8 years ago
parent
commit
3084dc9441
1 changed files with 2 additions and 6 deletions
  1. 2 6
      examples/js/Mirror.js

+ 2 - 6
examples/js/Mirror.js

@@ -109,7 +109,7 @@ THREE.Mirror = function ( width, height, options ) {
 
 
 	scope.material = material;
 	scope.material = material;
 
 
-	function updateTextureMatrix( camera ) {
+	scope.onBeforeRender = function ( renderer, scene, camera ) {
 
 
 		scope.updateMatrixWorld();
 		scope.updateMatrixWorld();
 
 
@@ -181,11 +181,7 @@ THREE.Mirror = function ( width, height, options ) {
 		projectionMatrix.elements[ 10 ] = clipPlane.z + 1.0 - clipBias;
 		projectionMatrix.elements[ 10 ] = clipPlane.z + 1.0 - clipBias;
 		projectionMatrix.elements[ 14 ] = clipPlane.w;
 		projectionMatrix.elements[ 14 ] = clipPlane.w;
 
 
-	}
-
-	scope.onBeforeRender = function ( renderer, scene, camera ) {
-
-		updateTextureMatrix( camera );
+		// Render
 
 
 		scope.visible = false;
 		scope.visible = false;