Explorar el Código

Changed camera matrix update in WebGLRenderer to happen just once per frame, no need to do it with every object.

alteredq hace 15 años
padre
commit
5d7e32a3af
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      src/renderers/WebGLRenderer.js

+ 2 - 1
src/renderers/WebGLRenderer.js

@@ -387,7 +387,6 @@ THREE.WebGLRenderer = function () {
     
     this.setupMatrices = function ( object, camera ) {
         
-        camera.autoUpdateMatrix && camera.updateMatrix();
         object.autoUpdateMatrix && object.updateMatrix();
 
         _viewMatrix.multiply( camera.matrix, object.matrix );
@@ -407,6 +406,8 @@ THREE.WebGLRenderer = function () {
     
 	this.render = function ( scene, camera ) {
         
+        camera.autoUpdateMatrix && camera.updateMatrix();
+
         var o, ol, object;
 
 		if ( this.autoClear ) {