Browse Source

Fixed glTF file loader (node to root)

luaacro 9 years ago
parent
commit
997153697b
2 changed files with 6 additions and 2 deletions
  1. 3 1
      loaders/glTF/babylon.glTFFileLoader.js
  2. 3 1
      loaders/glTF/babylon.glTFFileLoader.ts

+ 3 - 1
loaders/glTF/babylon.glTFFileLoader.js

@@ -472,8 +472,10 @@ var BABYLON;
             }
             if (!isInJoints) {
                 var mat = configureBoneTransformation(node);
-                nodeToRoot = new BABYLON.Bone(node.name, newSkeleton, null, mat, false);
+                nodeToRoot = new BABYLON.Bone(node.name, newSkeleton, null, mat);
                 nodeToRoot.id = nde;
+                // Remove root from bones
+                newSkeleton.bones = [];
                 break;
             }
         }

+ 3 - 1
loaders/glTF/babylon.glTFFileLoader.ts

@@ -524,8 +524,10 @@
 
             if (!isInJoints) {
                 var mat = configureBoneTransformation(node);
-                nodeToRoot = new Bone(node.name, newSkeleton, null, mat, false);
+                nodeToRoot = new Bone(node.name, newSkeleton, null, mat);
                 nodeToRoot.id = nde;
+                // Remove root from bones
+                newSkeleton.bones = [];
                 break;
             }
         }