Explorar o código

Merge pull request #1661 from abow/master

updated what's new and fixed minor issue
David Catuhe %!s(int64=8) %!d(string=hai) anos
pai
achega
f70afdbebe
Modificáronse 2 ficheiros con 5 adicións e 4 borrados
  1. 1 0
      dist/preview release/what's new.md
  2. 4 4
      src/Mesh/babylon.abstractMesh.ts

+ 1 - 0
dist/preview release/what's new.md

@@ -10,6 +10,7 @@
  - babylon.fontTexture.ts was moved from babylon.js to canvas2D ([nockawa](https://github.com/nockawa))
 
 ### Updates
+ - Added addChild, removeChild, setParent to AbstractMesh.  ([abow](https://github.com/abow))
  - `Effect.getVertexShaderSource()` and `Effect.getFragmentShaderSource()` now returns the effective shader code (including evaluation of #define) ([deltakosh](https://github.com/deltakosh))
 
 ### Canvas2D

+ 4 - 4
src/Mesh/babylon.abstractMesh.ts

@@ -1319,7 +1319,7 @@
 
                 var m = child.getWorldMatrix().multiply(invParentMatrix);
 
-                m.decompose(Vector3.Zero(), Quaternion.Identity(), position);
+                m.decompose(scale, rotation, position);
 
                 child.position.x = position.x;
                 child.position.y = position.y;
@@ -1344,9 +1344,9 @@
 
                 var rotation = Tmp.Quaternion[0];
                 var position = Tmp.Vector3[0];
-                var m1 = Tmp.Matrix[0];
-
-                child.getWorldMatrix().decompose(Vector3.Zero(), rotation, position);
+                var scale = Tmp.Vector3[1];
+                
+                child.getWorldMatrix().decompose(scale, rotation, position);
 
                 if (child.rotationQuaternion) {
                     child.rotationQuaternion.copyFrom(rotation);