2
0
Mr.doob 2 жил өмнө
parent
commit
4dc9a70c06

+ 2 - 2
examples/js/effects/AnaglyphEffect.js

@@ -62,8 +62,8 @@
 			this.render = function ( scene, camera ) {
 
 				const currentRenderTarget = renderer.getRenderTarget();
-				scene.updateMatrixWorld();
-				if ( camera.parent === null ) camera.updateMatrixWorld();
+				if ( scene.matrixWorldAutoUpdate === true ) scene.updateMatrixWorld();
+				if ( camera.parent === null && camera.matrixWorldAutoUpdate === true ) camera.updateMatrixWorld();
 
 				_stereo.update( camera );
 

+ 3 - 3
examples/js/effects/OutlineEffect.js

@@ -354,10 +354,10 @@
 			this.renderOutline = function ( scene, camera ) {
 
 				const currentAutoClear = renderer.autoClear;
-				const currentSceneAutoUpdate = scene.autoUpdate;
+				const currentSceneAutoUpdate = scene.matrixWorldAutoUpdate;
 				const currentSceneBackground = scene.background;
 				const currentShadowMapEnabled = renderer.shadowMap.enabled;
-				scene.autoUpdate = false;
+				scene.matrixWorldAutoUpdate = false;
 				scene.background = null;
 				renderer.autoClear = false;
 				renderer.shadowMap.enabled = false;
@@ -365,7 +365,7 @@
 				renderer.render( scene, camera );
 				scene.traverse( restoreOriginalMaterial );
 				cleanupCache();
-				scene.autoUpdate = currentSceneAutoUpdate;
+				scene.matrixWorldAutoUpdate = currentSceneAutoUpdate;
 				scene.background = currentSceneBackground;
 				renderer.autoClear = currentAutoClear;
 				renderer.shadowMap.enabled = currentShadowMapEnabled;

+ 2 - 2
examples/js/effects/ParallaxBarrierEffect.js

@@ -50,8 +50,8 @@
 
 			this.render = function ( scene, camera ) {
 
-				scene.updateMatrixWorld();
-				if ( camera.parent === null ) camera.updateMatrixWorld();
+				if ( scene.matrixWorldAutoUpdate === true ) scene.updateMatrixWorld();
+				if ( camera.parent === null && camera.matrixWorldAutoUpdate === true ) camera.updateMatrixWorld();
 
 				_stereo.update( camera );
 

+ 2 - 2
examples/js/effects/PeppersGhostEffect.js

@@ -57,8 +57,8 @@
 
 			this.render = function ( scene, camera ) {
 
-				scene.updateMatrixWorld();
-				if ( camera.parent === null ) camera.updateMatrixWorld();
+				if ( scene.matrixWorldAutoUpdate === true ) scene.updateMatrixWorld();
+				if ( camera.parent === null && camera.matrixWorldAutoUpdate === true ) camera.updateMatrixWorld();
 				camera.matrixWorld.decompose( _position, _quaternion, _scale ); // front
 
 				_cameraF.position.copy( _position );

+ 2 - 2
examples/js/effects/StereoEffect.js

@@ -23,8 +23,8 @@
 
 			this.render = function ( scene, camera ) {
 
-				scene.updateMatrixWorld();
-				if ( camera.parent === null ) camera.updateMatrixWorld();
+				if ( scene.matrixWorldAutoUpdate === true ) scene.updateMatrixWorld();
+				if ( camera.parent === null && camera.matrixWorldAutoUpdate === true ) camera.updateMatrixWorld();
 
 				_stereo.update( camera );
 

+ 22 - 0
examples/js/environments/RoomEnvironment.js

@@ -85,6 +85,28 @@
 
 		}
 
+		dispose() {
+
+			const resources = new Set();
+			this.traverse( object => {
+
+				if ( object.isMesh ) {
+
+					resources.add( object.geometry );
+					resources.add( object.material );
+
+				}
+
+			} );
+
+			for ( const resource of resources ) {
+
+				resource.dispose();
+
+			}
+
+		}
+
 	}
 
 	function createAreaLightMaterial( intensity ) {

+ 3 - 3
examples/js/loaders/FBXLoader.js

@@ -3676,7 +3676,7 @@
 		if ( transformData.preRotation ) {
 
 			const array = transformData.preRotation.map( THREE.MathUtils.degToRad );
-			array.push( transformData.eulerOrder );
+			array.push( transformData.eulerOrder || THREE.Euler.DefaultOrder );
 			lPreRotationM.makeRotationFromEuler( tempEuler.fromArray( array ) );
 
 		}
@@ -3684,7 +3684,7 @@
 		if ( transformData.rotation ) {
 
 			const array = transformData.rotation.map( THREE.MathUtils.degToRad );
-			array.push( transformData.eulerOrder );
+			array.push( transformData.eulerOrder || THREE.Euler.DefaultOrder );
 			lRotationM.makeRotationFromEuler( tempEuler.fromArray( array ) );
 
 		}
@@ -3692,7 +3692,7 @@
 		if ( transformData.postRotation ) {
 
 			const array = transformData.postRotation.map( THREE.MathUtils.degToRad );
-			array.push( transformData.eulerOrder );
+			array.push( transformData.eulerOrder || THREE.Euler.DefaultOrder );
 			lPostRotationM.makeRotationFromEuler( tempEuler.fromArray( array ) );
 			lPostRotationM.invert();
 

+ 2 - 2
examples/js/renderers/CSS2DRenderer.js

@@ -75,8 +75,8 @@
 
 			this.render = function ( scene, camera ) {
 
-				if ( scene.autoUpdate === true ) scene.updateMatrixWorld();
-				if ( camera.parent === null ) camera.updateMatrixWorld();
+				if ( scene.matrixWorldAutoUpdate === true ) scene.updateMatrixWorld();
+				if ( camera.parent === null && camera.matrixWorldAutoUpdate === true ) camera.updateMatrixWorld();
 
 				_viewMatrix.copy( camera.matrixWorldInverse );
 

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

@@ -117,8 +117,8 @@
 
 				}
 
-				if ( scene.autoUpdate === true ) scene.updateMatrixWorld();
-				if ( camera.parent === null ) camera.updateMatrixWorld();
+				if ( scene.matrixWorldAutoUpdate === true ) scene.updateMatrixWorld();
+				if ( camera.parent === null && camera.matrixWorldAutoUpdate === true ) camera.updateMatrixWorld();
 				let tx, ty;
 
 				if ( camera.isOrthographicCamera ) {

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

@@ -378,8 +378,8 @@
 				_lineCount = 0;
 				_spriteCount = 0;
 				_renderData.elements.length = 0;
-				if ( scene.autoUpdate === true ) scene.updateMatrixWorld();
-				if ( camera.parent === null ) camera.updateMatrixWorld();
+				if ( scene.matrixWorldAutoUpdate === true ) scene.updateMatrixWorld();
+				if ( camera.parent === null && camera.matrixWorldAutoUpdate === true ) camera.updateMatrixWorld();
 
 				_viewMatrix.copy( camera.matrixWorldInverse );