Kaynağa Gözat

Fix pivot issue

David Catuhe 7 yıl önce
ebeveyn
işleme
58e1766dfe

Dosya farkı çok büyük olduğundan ihmal edildi
+ 3172 - 3172
Playground/babylon.d.txt


Dosya farkı çok büyük olduğundan ihmal edildi
+ 3365 - 3365
dist/preview release/babylon.d.ts


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
dist/preview release/babylon.js


+ 4 - 4
dist/preview release/babylon.max.js

@@ -19272,6 +19272,10 @@ var BABYLON;
                 BABYLON.Tmp.Matrix[1].copyFrom(BABYLON.Tmp.Matrix[5]);
                 BABYLON.Tmp.Matrix[1].copyFrom(BABYLON.Tmp.Matrix[5]);
                 BABYLON.Tmp.Matrix[1].multiplyToRef(BABYLON.Tmp.Matrix[0], BABYLON.Tmp.Matrix[5]);
                 BABYLON.Tmp.Matrix[1].multiplyToRef(BABYLON.Tmp.Matrix[0], BABYLON.Tmp.Matrix[5]);
             }
             }
+            // Post multiply inverse of pivotMatrix
+            if (this._postMultiplyPivotMatrix) {
+                BABYLON.Tmp.Matrix[5].multiplyToRef(this._pivotMatrixInverse, BABYLON.Tmp.Matrix[5]);
+            }
             // Local world
             // Local world
             BABYLON.Tmp.Matrix[5].multiplyToRef(BABYLON.Tmp.Matrix[2], this._localWorld);
             BABYLON.Tmp.Matrix[5].multiplyToRef(BABYLON.Tmp.Matrix[2], this._localWorld);
             // Parent
             // Parent
@@ -19303,10 +19307,6 @@ var BABYLON;
             else {
             else {
                 this._worldMatrix.copyFrom(this._localWorld);
                 this._worldMatrix.copyFrom(this._localWorld);
             }
             }
-            // Post multiply inverse of pivotMatrix
-            if (this._postMultiplyPivotMatrix) {
-                this._worldMatrix.multiplyToRef(this._pivotMatrixInverse, this._worldMatrix);
-            }
             // Normal matrix
             // Normal matrix
             if (!this.ignoreNonUniformScaling) {
             if (!this.ignoreNonUniformScaling) {
                 if (this.scaling.isNonUniform) {
                 if (this.scaling.isNonUniform) {

+ 4 - 4
dist/preview release/babylon.no-module.max.js

@@ -19239,6 +19239,10 @@ var BABYLON;
                 BABYLON.Tmp.Matrix[1].copyFrom(BABYLON.Tmp.Matrix[5]);
                 BABYLON.Tmp.Matrix[1].copyFrom(BABYLON.Tmp.Matrix[5]);
                 BABYLON.Tmp.Matrix[1].multiplyToRef(BABYLON.Tmp.Matrix[0], BABYLON.Tmp.Matrix[5]);
                 BABYLON.Tmp.Matrix[1].multiplyToRef(BABYLON.Tmp.Matrix[0], BABYLON.Tmp.Matrix[5]);
             }
             }
+            // Post multiply inverse of pivotMatrix
+            if (this._postMultiplyPivotMatrix) {
+                BABYLON.Tmp.Matrix[5].multiplyToRef(this._pivotMatrixInverse, BABYLON.Tmp.Matrix[5]);
+            }
             // Local world
             // Local world
             BABYLON.Tmp.Matrix[5].multiplyToRef(BABYLON.Tmp.Matrix[2], this._localWorld);
             BABYLON.Tmp.Matrix[5].multiplyToRef(BABYLON.Tmp.Matrix[2], this._localWorld);
             // Parent
             // Parent
@@ -19270,10 +19274,6 @@ var BABYLON;
             else {
             else {
                 this._worldMatrix.copyFrom(this._localWorld);
                 this._worldMatrix.copyFrom(this._localWorld);
             }
             }
-            // Post multiply inverse of pivotMatrix
-            if (this._postMultiplyPivotMatrix) {
-                this._worldMatrix.multiplyToRef(this._pivotMatrixInverse, this._worldMatrix);
-            }
             // Normal matrix
             // Normal matrix
             if (!this.ignoreNonUniformScaling) {
             if (!this.ignoreNonUniformScaling) {
                 if (this.scaling.isNonUniform) {
                 if (this.scaling.isNonUniform) {

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
dist/preview release/babylon.worker.js


+ 4 - 4
dist/preview release/es6.js

@@ -19239,6 +19239,10 @@ var BABYLON;
                 BABYLON.Tmp.Matrix[1].copyFrom(BABYLON.Tmp.Matrix[5]);
                 BABYLON.Tmp.Matrix[1].copyFrom(BABYLON.Tmp.Matrix[5]);
                 BABYLON.Tmp.Matrix[1].multiplyToRef(BABYLON.Tmp.Matrix[0], BABYLON.Tmp.Matrix[5]);
                 BABYLON.Tmp.Matrix[1].multiplyToRef(BABYLON.Tmp.Matrix[0], BABYLON.Tmp.Matrix[5]);
             }
             }
+            // Post multiply inverse of pivotMatrix
+            if (this._postMultiplyPivotMatrix) {
+                BABYLON.Tmp.Matrix[5].multiplyToRef(this._pivotMatrixInverse, BABYLON.Tmp.Matrix[5]);
+            }
             // Local world
             // Local world
             BABYLON.Tmp.Matrix[5].multiplyToRef(BABYLON.Tmp.Matrix[2], this._localWorld);
             BABYLON.Tmp.Matrix[5].multiplyToRef(BABYLON.Tmp.Matrix[2], this._localWorld);
             // Parent
             // Parent
@@ -19270,10 +19274,6 @@ var BABYLON;
             else {
             else {
                 this._worldMatrix.copyFrom(this._localWorld);
                 this._worldMatrix.copyFrom(this._localWorld);
             }
             }
-            // Post multiply inverse of pivotMatrix
-            if (this._postMultiplyPivotMatrix) {
-                this._worldMatrix.multiplyToRef(this._pivotMatrixInverse, this._worldMatrix);
-            }
             // Normal matrix
             // Normal matrix
             if (!this.ignoreNonUniformScaling) {
             if (!this.ignoreNonUniformScaling) {
                 if (this.scaling.isNonUniform) {
                 if (this.scaling.isNonUniform) {

Dosya farkı çok büyük olduğundan ihmal edildi
+ 9 - 9
dist/preview release/viewer/babylon.viewer.js


+ 4 - 4
dist/preview release/viewer/babylon.viewer.max.js

@@ -19360,6 +19360,10 @@ var BABYLON;
                 BABYLON.Tmp.Matrix[1].copyFrom(BABYLON.Tmp.Matrix[5]);
                 BABYLON.Tmp.Matrix[1].copyFrom(BABYLON.Tmp.Matrix[5]);
                 BABYLON.Tmp.Matrix[1].multiplyToRef(BABYLON.Tmp.Matrix[0], BABYLON.Tmp.Matrix[5]);
                 BABYLON.Tmp.Matrix[1].multiplyToRef(BABYLON.Tmp.Matrix[0], BABYLON.Tmp.Matrix[5]);
             }
             }
+            // Post multiply inverse of pivotMatrix
+            if (this._postMultiplyPivotMatrix) {
+                BABYLON.Tmp.Matrix[5].multiplyToRef(this._pivotMatrixInverse, BABYLON.Tmp.Matrix[5]);
+            }
             // Local world
             // Local world
             BABYLON.Tmp.Matrix[5].multiplyToRef(BABYLON.Tmp.Matrix[2], this._localWorld);
             BABYLON.Tmp.Matrix[5].multiplyToRef(BABYLON.Tmp.Matrix[2], this._localWorld);
             // Parent
             // Parent
@@ -19391,10 +19395,6 @@ var BABYLON;
             else {
             else {
                 this._worldMatrix.copyFrom(this._localWorld);
                 this._worldMatrix.copyFrom(this._localWorld);
             }
             }
-            // Post multiply inverse of pivotMatrix
-            if (this._postMultiplyPivotMatrix) {
-                this._worldMatrix.multiplyToRef(this._pivotMatrixInverse, this._worldMatrix);
-            }
             // Normal matrix
             // Normal matrix
             if (!this.ignoreNonUniformScaling) {
             if (!this.ignoreNonUniformScaling) {
                 if (this.scaling.isNonUniform) {
                 if (this.scaling.isNonUniform) {

+ 7 - 6
src/Mesh/babylon.transformNode.ts

@@ -792,7 +792,7 @@ module BABYLON {
                 Matrix.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, Tmp.Matrix[0]);
                 Matrix.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, Tmp.Matrix[0]);
                 this._cache.rotation.copyFrom(this.rotation);
                 this._cache.rotation.copyFrom(this.rotation);
             }
             }
-
+          
             // Translation
             // Translation
             let camera = (<Camera>this.getScene().activeCamera);
             let camera = (<Camera>this.getScene().activeCamera);
 
 
@@ -809,7 +809,7 @@ module BABYLON {
             }
             }
 
 
             // Composing transformations
             // Composing transformations
-            this._pivotMatrix.multiplyToRef(Tmp.Matrix[1], Tmp.Matrix[4]);
+            this._pivotMatrix.multiplyToRef(Tmp.Matrix[1], Tmp.Matrix[4]);           
             Tmp.Matrix[4].multiplyToRef(Tmp.Matrix[0], Tmp.Matrix[5]);
             Tmp.Matrix[4].multiplyToRef(Tmp.Matrix[0], Tmp.Matrix[5]);
 
 
             // Billboarding (testing PG:http://www.babylonjs-playground.com/#UJEIL#13)
             // Billboarding (testing PG:http://www.babylonjs-playground.com/#UJEIL#13)
@@ -856,6 +856,11 @@ module BABYLON {
                 Tmp.Matrix[1].multiplyToRef(Tmp.Matrix[0], Tmp.Matrix[5]);
                 Tmp.Matrix[1].multiplyToRef(Tmp.Matrix[0], Tmp.Matrix[5]);
             }
             }
 
 
+            // Post multiply inverse of pivotMatrix
+            if (this._postMultiplyPivotMatrix) {
+                Tmp.Matrix[5].multiplyToRef(this._pivotMatrixInverse, Tmp.Matrix[5]);
+            }           
+
             // Local world
             // Local world
             Tmp.Matrix[5].multiplyToRef(Tmp.Matrix[2], this._localWorld);
             Tmp.Matrix[5].multiplyToRef(Tmp.Matrix[2], this._localWorld);
 
 
@@ -887,10 +892,6 @@ module BABYLON {
                 this._worldMatrix.copyFrom(this._localWorld);
                 this._worldMatrix.copyFrom(this._localWorld);
             }
             }
 
 
-            // Post multiply inverse of pivotMatrix
-            if (this._postMultiplyPivotMatrix) {
-                this._worldMatrix.multiplyToRef(this._pivotMatrixInverse, this._worldMatrix);
-            }
 
 
             // Normal matrix
             // Normal matrix
             if (!this.ignoreNonUniformScaling) {
             if (!this.ignoreNonUniformScaling) {