Sfoglia il codice sorgente

Merge pull request #449 from RaananW/patch-1

Transformation init in Skeleton
David Catuhe 11 anni fa
parent
commit
afc2807560
2 ha cambiato i file con 9 aggiunte e 2 eliminazioni
  1. 4 1
      Babylon/Bones/babylon.skeleton.js
  2. 5 1
      Babylon/Bones/babylon.skeleton.ts

+ 4 - 1
Babylon/Bones/babylon.skeleton.js

@@ -10,6 +10,9 @@ var BABYLON;
             this.bones = [];
             this._scene = scene;
             scene.skeletons.push(this);
+            this.prepare():
+            //make sure it will recalculate the matrix next time prepare is called.
+            this._isDirty = true;
         }
         // Members
         Skeleton.prototype.getTransformMatrices = function () {
@@ -68,4 +71,4 @@ var BABYLON;
     })();
     BABYLON.Skeleton = Skeleton;
 })(BABYLON || (BABYLON = {}));
-//# sourceMappingURL=babylon.skeleton.js.map
+//# sourceMappingURL=babylon.skeleton.js.map

+ 5 - 1
Babylon/Bones/babylon.skeleton.ts

@@ -14,6 +14,10 @@
             this._scene = scene;
 
             scene.skeletons.push(this);
+            
+            this.prepare();
+            //make sure it will recalculate the matrix next time prepare is called.
+            this._isDirty = true; 
         }
 
         // Members
@@ -86,4 +90,4 @@
             return result;
         }
     }
-}
+}