提交 576f87cb 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #10548 from donmccurdy/feat-global-scene-matrix-update

GLTFShader: Update scene and camera matrices once, globally.
......@@ -108,6 +108,15 @@ THREE.GLTFLoader = ( function () {
update: function ( scene, camera ) {
// update scene graph
scene.updateMatrixWorld();
// update camera matrices and frustum
camera.updateMatrixWorld();
camera.matrixWorldInverse.getInverse( camera.matrixWorld );
for ( var name in objects ) {
var object = objects[ name ];
......@@ -175,15 +184,6 @@ THREE.GLTFLoader = ( function () {
// Update - update all the uniform values
GLTFShader.prototype.update = function ( scene, camera ) {
// update scene graph
scene.updateMatrixWorld();
// update camera matrices and frustum
camera.updateMatrixWorld();
camera.matrixWorldInverse.getInverse( camera.matrixWorld );
var boundUniforms = this.boundUniforms;
for ( var name in boundUniforms ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册