瀏覽代碼

Merge remote-tracking branch 'upstream/master'

Sebastien Vandenberghe 7 年之前
父節點
當前提交
4a95ac761c

文件差異過大導致無法顯示
+ 3704 - 3696
Playground/babylon.d.txt


文件差異過大導致無法顯示
+ 15055 - 15055
dist/preview release/babylon.d.ts


文件差異過大導致無法顯示
+ 52 - 52
dist/preview release/babylon.js


文件差異過大導致無法顯示
+ 18 - 3
dist/preview release/babylon.max.js


文件差異過大導致無法顯示
+ 18 - 3
dist/preview release/babylon.no-module.max.js


文件差異過大導致無法顯示
+ 52 - 52
dist/preview release/babylon.worker.js


文件差異過大導致無法顯示
+ 18 - 3
dist/preview release/es6.js


文件差異過大導致無法顯示
+ 13 - 13
dist/preview release/viewer/babylon.viewer.js


文件差異過大導致無法顯示
+ 18 - 3
dist/preview release/viewer/babylon.viewer.max.js


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

@@ -97,6 +97,7 @@
 - Node's setParent(node.parent) will no longer throw an exception when parent is undefined and will behave the same as setParent(null) ([TrevorDev](https://github.com/TrevorDev))
 - Mesh.MergeMeshes flips triangles on meshes with negative scaling ([SvenFrankson](http://svenfrankson.com))
 - Avoid firing button events multiple times when calling vrController.attachMesh() ([TrevorDev]
+- Parse geometry when load binary mesh ([SinhNQ](https://github.com/quocsinh))
 
 ### Core Engine
 

+ 9 - 1
src/Mesh/babylon.geometry.ts

@@ -1144,7 +1144,15 @@
 
                 if (binaryInfo.matricesIndicesAttrDesc && binaryInfo.matricesIndicesAttrDesc.count > 0) {
                     var matricesIndicesData = new Int32Array(parsedGeometry, binaryInfo.matricesIndicesAttrDesc.offset, binaryInfo.matricesIndicesAttrDesc.count);
-                    mesh.setVerticesData(VertexBuffer.MatricesIndicesKind, matricesIndicesData, false);
+                    var floatIndices = [];
+                    for (var i = 0; i < matricesIndicesData.length; i++) {
+                        var index = matricesIndicesData[i];
+                        floatIndices.push(index & 0x000000FF);
+                        floatIndices.push((index & 0x0000FF00) >> 8);
+                        floatIndices.push((index & 0x00FF0000) >> 16);
+                        floatIndices.push(index >> 24);
+                    }
+                    mesh.setVerticesData(VertexBuffer.MatricesIndicesKind, floatIndices, false);
                 }
 
                 if (binaryInfo.matricesWeightsAttrDesc && binaryInfo.matricesWeightsAttrDesc.count > 0) {