David Catuhe 7 gadi atpakaļ
vecāks
revīzija
d2b7adf882

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 6844 - 6365
Playground/babylon.d.txt


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 6776 - 6297
dist/preview release/babylon.d.ts


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 15 - 15
dist/preview release/babylon.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 589 - 162
dist/preview release/babylon.max.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 589 - 162
dist/preview release/babylon.no-module.max.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 15 - 15
dist/preview release/babylon.worker.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 589 - 162
dist/preview release/es6.js


+ 3 - 3
dist/preview release/loaders/babylon.glTF2FileLoader.d.ts

@@ -644,10 +644,10 @@ declare module BABYLON.GLTF2 {
         private _loadMorphTargetVertexDataAsync(context, babylonGeometry, attributes, babylonMorphTarget);
         private static _LoadTransform(node, babylonNode);
         private _loadSkinAsync(context, node, mesh, skin);
+        private _loadBones(context, skin);
+        private _loadBone(node, skin, babylonBones);
         private _loadSkinInverseBindMatricesDataAsync(context, skin);
-        private _createBone(node, skin, parent, localMatrix, baseMatrix, index);
-        private _loadBones(context, skin, inverseBindMatricesData);
-        private _loadBone(node, skin, inverseBindMatricesData, babylonBones);
+        private _updateBoneMatrices(babylonSkeleton, inverseBindMatricesData);
         private _getNodeMatrix(node);
         private _loadAnimationsAsync();
         private _loadAnimationAsync(context, animation);

+ 43 - 37
dist/preview release/loaders/babylon.glTF2FileLoader.js

@@ -1026,7 +1026,6 @@ var BABYLON;
                 return Promise.all(promises).then(function () { });
             };
             GLTFLoader.prototype._loadMeshAsync = function (context, node, mesh, babylonMesh) {
-                // TODO: instancing
                 var _this = this;
                 var promises = new Array();
                 var primitives = mesh.primitives;
@@ -1228,9 +1227,9 @@ var BABYLON;
             };
             GLTFLoader.prototype._loadSkinAsync = function (context, node, mesh, skin) {
                 var _this = this;
-                var assignSkeleton = function () {
+                var assignSkeleton = function (skeleton) {
                     _this._forEachPrimitive(node, function (babylonMesh) {
-                        babylonMesh.skeleton = skin._babylonSkeleton;
+                        babylonMesh.skeleton = skeleton;
                     });
                     // Ignore the TRS of skinned nodes.
                     // See https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins (second implementation note)
@@ -1241,61 +1240,68 @@ var BABYLON;
                 };
                 if (skin._loaded) {
                     return skin._loaded.then(function () {
-                        assignSkeleton();
+                        assignSkeleton(skin._babylonSkeleton);
                     });
                 }
-                // TODO: split into two parts so that bones are created before inverseBindMatricesData is loaded (for compiling materials).
+                var skeletonId = "skeleton" + skin._index;
+                var babylonSkeleton = new BABYLON.Skeleton(skin.name || skeletonId, skeletonId, this._babylonScene);
+                skin._babylonSkeleton = babylonSkeleton;
+                this._loadBones(context, skin);
+                assignSkeleton(babylonSkeleton);
                 return (skin._loaded = this._loadSkinInverseBindMatricesDataAsync(context, skin).then(function (inverseBindMatricesData) {
-                    var skeletonId = "skeleton" + skin._index;
-                    var babylonSkeleton = new BABYLON.Skeleton(skin.name || skeletonId, skeletonId, _this._babylonScene);
-                    skin._babylonSkeleton = babylonSkeleton;
-                    _this._loadBones(context, skin, inverseBindMatricesData);
-                    assignSkeleton();
+                    _this._updateBoneMatrices(babylonSkeleton, inverseBindMatricesData);
                 }));
             };
-            GLTFLoader.prototype._loadSkinInverseBindMatricesDataAsync = function (context, skin) {
-                if (skin.inverseBindMatrices == undefined) {
-                    return Promise.resolve(null);
-                }
-                var accessor = GLTFLoader._GetProperty(context + "/inverseBindMatrices", this._gltf.accessors, skin.inverseBindMatrices);
-                return this._loadAccessorAsync("#/accessors/" + accessor._index, accessor).then(function (data) {
-                    return data;
-                });
-            };
-            GLTFLoader.prototype._createBone = function (node, skin, parent, localMatrix, baseMatrix, index) {
-                var babylonBone = new BABYLON.Bone(node.name || "joint" + node._index, skin._babylonSkeleton, parent, localMatrix, null, baseMatrix, index);
-                node._babylonAnimationTargets = node._babylonAnimationTargets || [];
-                node._babylonAnimationTargets.push(babylonBone);
-                return babylonBone;
-            };
-            GLTFLoader.prototype._loadBones = function (context, skin, inverseBindMatricesData) {
+            GLTFLoader.prototype._loadBones = function (context, skin) {
                 var babylonBones = {};
                 for (var _i = 0, _a = skin.joints; _i < _a.length; _i++) {
                     var index = _a[_i];
                     var node = GLTFLoader._GetProperty(context + "/joints/" + index, this._gltf.nodes, index);
-                    this._loadBone(node, skin, inverseBindMatricesData, babylonBones);
+                    this._loadBone(node, skin, babylonBones);
                 }
             };
-            GLTFLoader.prototype._loadBone = function (node, skin, inverseBindMatricesData, babylonBones) {
+            GLTFLoader.prototype._loadBone = function (node, skin, babylonBones) {
                 var babylonBone = babylonBones[node._index];
                 if (babylonBone) {
                     return babylonBone;
                 }
-                var boneIndex = skin.joints.indexOf(node._index);
-                var baseMatrix = BABYLON.Matrix.Identity();
-                if (inverseBindMatricesData && boneIndex !== -1) {
-                    baseMatrix = BABYLON.Matrix.FromArray(inverseBindMatricesData, boneIndex * 16);
-                    baseMatrix.invertToRef(baseMatrix);
-                }
                 var babylonParentBone = null;
                 if (node._parent._babylonMesh !== this._rootBabylonMesh) {
-                    babylonParentBone = this._loadBone(node._parent, skin, inverseBindMatricesData, babylonBones);
-                    baseMatrix.multiplyToRef(babylonParentBone.getInvertedAbsoluteTransform(), baseMatrix);
+                    babylonParentBone = this._loadBone(node._parent, skin, babylonBones);
                 }
-                babylonBone = this._createBone(node, skin, babylonParentBone, this._getNodeMatrix(node), baseMatrix, boneIndex);
+                var boneIndex = skin.joints.indexOf(node._index);
+                babylonBone = new BABYLON.Bone(node.name || "joint" + node._index, skin._babylonSkeleton, babylonParentBone, this._getNodeMatrix(node), null, null, boneIndex);
                 babylonBones[node._index] = babylonBone;
+                node._babylonAnimationTargets = node._babylonAnimationTargets || [];
+                node._babylonAnimationTargets.push(babylonBone);
                 return babylonBone;
             };
+            GLTFLoader.prototype._loadSkinInverseBindMatricesDataAsync = function (context, skin) {
+                if (skin.inverseBindMatrices == undefined) {
+                    return Promise.resolve(null);
+                }
+                var accessor = GLTFLoader._GetProperty(context + "/inverseBindMatrices", this._gltf.accessors, skin.inverseBindMatrices);
+                return this._loadAccessorAsync("#/accessors/" + accessor._index, accessor).then(function (data) {
+                    return data;
+                });
+            };
+            GLTFLoader.prototype._updateBoneMatrices = function (babylonSkeleton, inverseBindMatricesData) {
+                for (var _i = 0, _a = babylonSkeleton.bones; _i < _a.length; _i++) {
+                    var babylonBone = _a[_i];
+                    var baseMatrix = BABYLON.Matrix.Identity();
+                    var boneIndex = babylonBone._index;
+                    if (inverseBindMatricesData && boneIndex !== -1) {
+                        BABYLON.Matrix.FromArrayToRef(inverseBindMatricesData, boneIndex * 16, baseMatrix);
+                        baseMatrix.invertToRef(baseMatrix);
+                    }
+                    var babylonParentBone = babylonBone.getParent();
+                    if (babylonParentBone) {
+                        baseMatrix.multiplyToRef(babylonParentBone.getInvertedAbsoluteTransform(), baseMatrix);
+                    }
+                    babylonBone.updateMatrix(baseMatrix, false, false);
+                    babylonBone._updateDifferenceMatrix(undefined, false);
+                }
+            };
             GLTFLoader.prototype._getNodeMatrix = function (node) {
                 return node.matrix ?
                     BABYLON.Matrix.FromArray(node.matrix) :

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 2 - 2
dist/preview release/loaders/babylon.glTF2FileLoader.min.js


+ 3 - 3
dist/preview release/loaders/babylon.glTFFileLoader.d.ts

@@ -1220,10 +1220,10 @@ declare module BABYLON.GLTF2 {
         private _loadMorphTargetVertexDataAsync(context, babylonGeometry, attributes, babylonMorphTarget);
         private static _LoadTransform(node, babylonNode);
         private _loadSkinAsync(context, node, mesh, skin);
+        private _loadBones(context, skin);
+        private _loadBone(node, skin, babylonBones);
         private _loadSkinInverseBindMatricesDataAsync(context, skin);
-        private _createBone(node, skin, parent, localMatrix, baseMatrix, index);
-        private _loadBones(context, skin, inverseBindMatricesData);
-        private _loadBone(node, skin, inverseBindMatricesData, babylonBones);
+        private _updateBoneMatrices(babylonSkeleton, inverseBindMatricesData);
         private _getNodeMatrix(node);
         private _loadAnimationsAsync();
         private _loadAnimationAsync(context, animation);

+ 43 - 37
dist/preview release/loaders/babylon.glTFFileLoader.js

@@ -3241,7 +3241,6 @@ var BABYLON;
                 return Promise.all(promises).then(function () { });
             };
             GLTFLoader.prototype._loadMeshAsync = function (context, node, mesh, babylonMesh) {
-                // TODO: instancing
                 var _this = this;
                 var promises = new Array();
                 var primitives = mesh.primitives;
@@ -3443,9 +3442,9 @@ var BABYLON;
             };
             GLTFLoader.prototype._loadSkinAsync = function (context, node, mesh, skin) {
                 var _this = this;
-                var assignSkeleton = function () {
+                var assignSkeleton = function (skeleton) {
                     _this._forEachPrimitive(node, function (babylonMesh) {
-                        babylonMesh.skeleton = skin._babylonSkeleton;
+                        babylonMesh.skeleton = skeleton;
                     });
                     // Ignore the TRS of skinned nodes.
                     // See https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins (second implementation note)
@@ -3456,61 +3455,68 @@ var BABYLON;
                 };
                 if (skin._loaded) {
                     return skin._loaded.then(function () {
-                        assignSkeleton();
+                        assignSkeleton(skin._babylonSkeleton);
                     });
                 }
-                // TODO: split into two parts so that bones are created before inverseBindMatricesData is loaded (for compiling materials).
+                var skeletonId = "skeleton" + skin._index;
+                var babylonSkeleton = new BABYLON.Skeleton(skin.name || skeletonId, skeletonId, this._babylonScene);
+                skin._babylonSkeleton = babylonSkeleton;
+                this._loadBones(context, skin);
+                assignSkeleton(babylonSkeleton);
                 return (skin._loaded = this._loadSkinInverseBindMatricesDataAsync(context, skin).then(function (inverseBindMatricesData) {
-                    var skeletonId = "skeleton" + skin._index;
-                    var babylonSkeleton = new BABYLON.Skeleton(skin.name || skeletonId, skeletonId, _this._babylonScene);
-                    skin._babylonSkeleton = babylonSkeleton;
-                    _this._loadBones(context, skin, inverseBindMatricesData);
-                    assignSkeleton();
+                    _this._updateBoneMatrices(babylonSkeleton, inverseBindMatricesData);
                 }));
             };
-            GLTFLoader.prototype._loadSkinInverseBindMatricesDataAsync = function (context, skin) {
-                if (skin.inverseBindMatrices == undefined) {
-                    return Promise.resolve(null);
-                }
-                var accessor = GLTFLoader._GetProperty(context + "/inverseBindMatrices", this._gltf.accessors, skin.inverseBindMatrices);
-                return this._loadAccessorAsync("#/accessors/" + accessor._index, accessor).then(function (data) {
-                    return data;
-                });
-            };
-            GLTFLoader.prototype._createBone = function (node, skin, parent, localMatrix, baseMatrix, index) {
-                var babylonBone = new BABYLON.Bone(node.name || "joint" + node._index, skin._babylonSkeleton, parent, localMatrix, null, baseMatrix, index);
-                node._babylonAnimationTargets = node._babylonAnimationTargets || [];
-                node._babylonAnimationTargets.push(babylonBone);
-                return babylonBone;
-            };
-            GLTFLoader.prototype._loadBones = function (context, skin, inverseBindMatricesData) {
+            GLTFLoader.prototype._loadBones = function (context, skin) {
                 var babylonBones = {};
                 for (var _i = 0, _a = skin.joints; _i < _a.length; _i++) {
                     var index = _a[_i];
                     var node = GLTFLoader._GetProperty(context + "/joints/" + index, this._gltf.nodes, index);
-                    this._loadBone(node, skin, inverseBindMatricesData, babylonBones);
+                    this._loadBone(node, skin, babylonBones);
                 }
             };
-            GLTFLoader.prototype._loadBone = function (node, skin, inverseBindMatricesData, babylonBones) {
+            GLTFLoader.prototype._loadBone = function (node, skin, babylonBones) {
                 var babylonBone = babylonBones[node._index];
                 if (babylonBone) {
                     return babylonBone;
                 }
-                var boneIndex = skin.joints.indexOf(node._index);
-                var baseMatrix = BABYLON.Matrix.Identity();
-                if (inverseBindMatricesData && boneIndex !== -1) {
-                    baseMatrix = BABYLON.Matrix.FromArray(inverseBindMatricesData, boneIndex * 16);
-                    baseMatrix.invertToRef(baseMatrix);
-                }
                 var babylonParentBone = null;
                 if (node._parent._babylonMesh !== this._rootBabylonMesh) {
-                    babylonParentBone = this._loadBone(node._parent, skin, inverseBindMatricesData, babylonBones);
-                    baseMatrix.multiplyToRef(babylonParentBone.getInvertedAbsoluteTransform(), baseMatrix);
+                    babylonParentBone = this._loadBone(node._parent, skin, babylonBones);
                 }
-                babylonBone = this._createBone(node, skin, babylonParentBone, this._getNodeMatrix(node), baseMatrix, boneIndex);
+                var boneIndex = skin.joints.indexOf(node._index);
+                babylonBone = new BABYLON.Bone(node.name || "joint" + node._index, skin._babylonSkeleton, babylonParentBone, this._getNodeMatrix(node), null, null, boneIndex);
                 babylonBones[node._index] = babylonBone;
+                node._babylonAnimationTargets = node._babylonAnimationTargets || [];
+                node._babylonAnimationTargets.push(babylonBone);
                 return babylonBone;
             };
+            GLTFLoader.prototype._loadSkinInverseBindMatricesDataAsync = function (context, skin) {
+                if (skin.inverseBindMatrices == undefined) {
+                    return Promise.resolve(null);
+                }
+                var accessor = GLTFLoader._GetProperty(context + "/inverseBindMatrices", this._gltf.accessors, skin.inverseBindMatrices);
+                return this._loadAccessorAsync("#/accessors/" + accessor._index, accessor).then(function (data) {
+                    return data;
+                });
+            };
+            GLTFLoader.prototype._updateBoneMatrices = function (babylonSkeleton, inverseBindMatricesData) {
+                for (var _i = 0, _a = babylonSkeleton.bones; _i < _a.length; _i++) {
+                    var babylonBone = _a[_i];
+                    var baseMatrix = BABYLON.Matrix.Identity();
+                    var boneIndex = babylonBone._index;
+                    if (inverseBindMatricesData && boneIndex !== -1) {
+                        BABYLON.Matrix.FromArrayToRef(inverseBindMatricesData, boneIndex * 16, baseMatrix);
+                        baseMatrix.invertToRef(baseMatrix);
+                    }
+                    var babylonParentBone = babylonBone.getParent();
+                    if (babylonParentBone) {
+                        baseMatrix.multiplyToRef(babylonParentBone.getInvertedAbsoluteTransform(), baseMatrix);
+                    }
+                    babylonBone.updateMatrix(baseMatrix, false, false);
+                    babylonBone._updateDifferenceMatrix(undefined, false);
+                }
+            };
             GLTFLoader.prototype._getNodeMatrix = function (node) {
                 return node.matrix ?
                     BABYLON.Matrix.FromArray(node.matrix) :

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 3 - 3
dist/preview release/loaders/babylon.glTFFileLoader.min.js


+ 3 - 3
dist/preview release/loaders/babylonjs.loaders.d.ts

@@ -1316,10 +1316,10 @@ declare module BABYLON.GLTF2 {
         private _loadMorphTargetVertexDataAsync(context, babylonGeometry, attributes, babylonMorphTarget);
         private static _LoadTransform(node, babylonNode);
         private _loadSkinAsync(context, node, mesh, skin);
+        private _loadBones(context, skin);
+        private _loadBone(node, skin, babylonBones);
         private _loadSkinInverseBindMatricesDataAsync(context, skin);
-        private _createBone(node, skin, parent, localMatrix, baseMatrix, index);
-        private _loadBones(context, skin, inverseBindMatricesData);
-        private _loadBone(node, skin, inverseBindMatricesData, babylonBones);
+        private _updateBoneMatrices(babylonSkeleton, inverseBindMatricesData);
         private _getNodeMatrix(node);
         private _loadAnimationsAsync();
         private _loadAnimationAsync(context, animation);

+ 43 - 37
dist/preview release/loaders/babylonjs.loaders.js

@@ -4223,7 +4223,6 @@ var BABYLON;
                 return Promise.all(promises).then(function () { });
             };
             GLTFLoader.prototype._loadMeshAsync = function (context, node, mesh, babylonMesh) {
-                // TODO: instancing
                 var _this = this;
                 var promises = new Array();
                 var primitives = mesh.primitives;
@@ -4425,9 +4424,9 @@ var BABYLON;
             };
             GLTFLoader.prototype._loadSkinAsync = function (context, node, mesh, skin) {
                 var _this = this;
-                var assignSkeleton = function () {
+                var assignSkeleton = function (skeleton) {
                     _this._forEachPrimitive(node, function (babylonMesh) {
-                        babylonMesh.skeleton = skin._babylonSkeleton;
+                        babylonMesh.skeleton = skeleton;
                     });
                     // Ignore the TRS of skinned nodes.
                     // See https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins (second implementation note)
@@ -4438,61 +4437,68 @@ var BABYLON;
                 };
                 if (skin._loaded) {
                     return skin._loaded.then(function () {
-                        assignSkeleton();
+                        assignSkeleton(skin._babylonSkeleton);
                     });
                 }
-                // TODO: split into two parts so that bones are created before inverseBindMatricesData is loaded (for compiling materials).
+                var skeletonId = "skeleton" + skin._index;
+                var babylonSkeleton = new BABYLON.Skeleton(skin.name || skeletonId, skeletonId, this._babylonScene);
+                skin._babylonSkeleton = babylonSkeleton;
+                this._loadBones(context, skin);
+                assignSkeleton(babylonSkeleton);
                 return (skin._loaded = this._loadSkinInverseBindMatricesDataAsync(context, skin).then(function (inverseBindMatricesData) {
-                    var skeletonId = "skeleton" + skin._index;
-                    var babylonSkeleton = new BABYLON.Skeleton(skin.name || skeletonId, skeletonId, _this._babylonScene);
-                    skin._babylonSkeleton = babylonSkeleton;
-                    _this._loadBones(context, skin, inverseBindMatricesData);
-                    assignSkeleton();
+                    _this._updateBoneMatrices(babylonSkeleton, inverseBindMatricesData);
                 }));
             };
-            GLTFLoader.prototype._loadSkinInverseBindMatricesDataAsync = function (context, skin) {
-                if (skin.inverseBindMatrices == undefined) {
-                    return Promise.resolve(null);
-                }
-                var accessor = GLTFLoader._GetProperty(context + "/inverseBindMatrices", this._gltf.accessors, skin.inverseBindMatrices);
-                return this._loadAccessorAsync("#/accessors/" + accessor._index, accessor).then(function (data) {
-                    return data;
-                });
-            };
-            GLTFLoader.prototype._createBone = function (node, skin, parent, localMatrix, baseMatrix, index) {
-                var babylonBone = new BABYLON.Bone(node.name || "joint" + node._index, skin._babylonSkeleton, parent, localMatrix, null, baseMatrix, index);
-                node._babylonAnimationTargets = node._babylonAnimationTargets || [];
-                node._babylonAnimationTargets.push(babylonBone);
-                return babylonBone;
-            };
-            GLTFLoader.prototype._loadBones = function (context, skin, inverseBindMatricesData) {
+            GLTFLoader.prototype._loadBones = function (context, skin) {
                 var babylonBones = {};
                 for (var _i = 0, _a = skin.joints; _i < _a.length; _i++) {
                     var index = _a[_i];
                     var node = GLTFLoader._GetProperty(context + "/joints/" + index, this._gltf.nodes, index);
-                    this._loadBone(node, skin, inverseBindMatricesData, babylonBones);
+                    this._loadBone(node, skin, babylonBones);
                 }
             };
-            GLTFLoader.prototype._loadBone = function (node, skin, inverseBindMatricesData, babylonBones) {
+            GLTFLoader.prototype._loadBone = function (node, skin, babylonBones) {
                 var babylonBone = babylonBones[node._index];
                 if (babylonBone) {
                     return babylonBone;
                 }
-                var boneIndex = skin.joints.indexOf(node._index);
-                var baseMatrix = BABYLON.Matrix.Identity();
-                if (inverseBindMatricesData && boneIndex !== -1) {
-                    baseMatrix = BABYLON.Matrix.FromArray(inverseBindMatricesData, boneIndex * 16);
-                    baseMatrix.invertToRef(baseMatrix);
-                }
                 var babylonParentBone = null;
                 if (node._parent._babylonMesh !== this._rootBabylonMesh) {
-                    babylonParentBone = this._loadBone(node._parent, skin, inverseBindMatricesData, babylonBones);
-                    baseMatrix.multiplyToRef(babylonParentBone.getInvertedAbsoluteTransform(), baseMatrix);
+                    babylonParentBone = this._loadBone(node._parent, skin, babylonBones);
                 }
-                babylonBone = this._createBone(node, skin, babylonParentBone, this._getNodeMatrix(node), baseMatrix, boneIndex);
+                var boneIndex = skin.joints.indexOf(node._index);
+                babylonBone = new BABYLON.Bone(node.name || "joint" + node._index, skin._babylonSkeleton, babylonParentBone, this._getNodeMatrix(node), null, null, boneIndex);
                 babylonBones[node._index] = babylonBone;
+                node._babylonAnimationTargets = node._babylonAnimationTargets || [];
+                node._babylonAnimationTargets.push(babylonBone);
                 return babylonBone;
             };
+            GLTFLoader.prototype._loadSkinInverseBindMatricesDataAsync = function (context, skin) {
+                if (skin.inverseBindMatrices == undefined) {
+                    return Promise.resolve(null);
+                }
+                var accessor = GLTFLoader._GetProperty(context + "/inverseBindMatrices", this._gltf.accessors, skin.inverseBindMatrices);
+                return this._loadAccessorAsync("#/accessors/" + accessor._index, accessor).then(function (data) {
+                    return data;
+                });
+            };
+            GLTFLoader.prototype._updateBoneMatrices = function (babylonSkeleton, inverseBindMatricesData) {
+                for (var _i = 0, _a = babylonSkeleton.bones; _i < _a.length; _i++) {
+                    var babylonBone = _a[_i];
+                    var baseMatrix = BABYLON.Matrix.Identity();
+                    var boneIndex = babylonBone._index;
+                    if (inverseBindMatricesData && boneIndex !== -1) {
+                        BABYLON.Matrix.FromArrayToRef(inverseBindMatricesData, boneIndex * 16, baseMatrix);
+                        baseMatrix.invertToRef(baseMatrix);
+                    }
+                    var babylonParentBone = babylonBone.getParent();
+                    if (babylonParentBone) {
+                        baseMatrix.multiplyToRef(babylonParentBone.getInvertedAbsoluteTransform(), baseMatrix);
+                    }
+                    babylonBone.updateMatrix(baseMatrix, false, false);
+                    babylonBone._updateDifferenceMatrix(undefined, false);
+                }
+            };
             GLTFLoader.prototype._getNodeMatrix = function (node) {
                 return node.matrix ?
                     BABYLON.Matrix.FromArray(node.matrix) :

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 1
dist/preview release/loaders/babylonjs.loaders.min.js


+ 3 - 3
dist/preview release/loaders/babylonjs.loaders.module.d.ts

@@ -1323,10 +1323,10 @@ declare module BABYLON.GLTF2 {
         private _loadMorphTargetVertexDataAsync(context, babylonGeometry, attributes, babylonMorphTarget);
         private static _LoadTransform(node, babylonNode);
         private _loadSkinAsync(context, node, mesh, skin);
+        private _loadBones(context, skin);
+        private _loadBone(node, skin, babylonBones);
         private _loadSkinInverseBindMatricesDataAsync(context, skin);
-        private _createBone(node, skin, parent, localMatrix, baseMatrix, index);
-        private _loadBones(context, skin, inverseBindMatricesData);
-        private _loadBone(node, skin, inverseBindMatricesData, babylonBones);
+        private _updateBoneMatrices(babylonSkeleton, inverseBindMatricesData);
         private _getNodeMatrix(node);
         private _loadAnimationsAsync();
         private _loadAnimationAsync(context, animation);

+ 3 - 37
dist/preview release/typedocValidationBaseline.json

@@ -1,7 +1,7 @@
 {
-  "errors": 5116,
+  "errors": 4947,
   "babylon.typedoc.json": {
-    "errors": 5116,
+    "errors": 4947,
     "JoystickAxis": {
       "Enumeration": {
         "Comments": {
@@ -2224,7 +2224,7 @@
           }
         }
       }
-    },    
+    },
     "Arc2": {
       "Class": {
         "Comments": {
@@ -25990,40 +25990,6 @@
         }
       }
     },
-    "IAnimationKey": {
-      "Interface": {
-        "Comments": {
-          "MissingText": true
-        }
-      },
-      "Property": {
-        "frame": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "inTangent": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "interpolation": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "outTangent": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "value": {
-          "Comments": {
-            "MissingText": true
-          }
-        }
-      }
-    },
     "ICameraInput": {
       "Interface": {
         "Comments": {

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 15 - 15
dist/preview release/viewer/babylon.viewer.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 589 - 162
dist/preview release/viewer/babylon.viewer.max.js