Переглянути джерело

Merge pull request #18244 from donutcoffee/dev

Examples: Make CSS Renderers respect Scene.autoUpdate.
Michael Herzog 5 роки тому
батько
коміт
b0d23ae146

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

@@ -161,8 +161,8 @@ THREE.CSS2DRenderer = function () {
 	};
 
 	this.render = function ( scene, camera ) {
-
-		scene.updateMatrixWorld();
+		
+		if ( scene.autoUpdate === true ) { scene.updateMatrixWorld(); }
 
 		if ( camera.parent === null ) camera.updateMatrixWorld();
 

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

@@ -296,7 +296,7 @@ THREE.CSS3DRenderer = function () {
 
 		}
 
-		scene.updateMatrixWorld();
+		if ( scene.autoUpdate === true ) { scene.updateMatrixWorld(); }
 
 		if ( camera.parent === null ) camera.updateMatrixWorld();