Gary Hsu 6 年 前
コミット
a6fef9eb27
2 ファイル変更3 行追加3 行削除
  1. 2 2
      loaders/src/OBJ/objFileLoader.ts
  2. 1 1
      loaders/src/glTF/1.0/glTFLoader.ts

+ 2 - 2
loaders/src/OBJ/objFileLoader.ts

@@ -1,4 +1,4 @@
-import { Nullable, FloatArray } from "babylonjs/types";
+import { Nullable, FloatArray, IndicesArray } from "babylonjs/types";
 import { Vector3, Vector2, Color3, Color4 } from "babylonjs/Maths/math";
 import { Tools } from "babylonjs/Misc/tools";
 import { VertexData } from "babylonjs/Meshes/mesh.vertexData";
@@ -1003,7 +1003,7 @@ export class OBJFileLoader implements ISceneLoaderPluginAsync {
             var vertexData: VertexData = new VertexData(); //The container for the values
             //Set the data for the babylonMesh
             vertexData.uvs = handledMesh.uvs as FloatArray;
-            vertexData.indices = handledMesh.indices as FloatArray;
+            vertexData.indices = handledMesh.indices as IndicesArray;
             vertexData.positions = handledMesh.positions as FloatArray;
             if (OBJFileLoader.COMPUTE_NORMALS === true) {
                 let normals: Array<number> = new Array<number>();

+ 1 - 1
loaders/src/glTF/1.0/glTFLoader.ts

@@ -700,7 +700,7 @@ var importMesh = (gltfRuntime: IGLTFRuntime, node: IGLTFNode, meshes: string[],
                 buffer = GLTFUtils.GetBufferFromAccessor(gltfRuntime, accessor);
 
                 tempVertexData.indices = new Int32Array(buffer.length);
-                (<Float32Array>tempVertexData.indices).set(buffer);
+                tempVertexData.indices.set(buffer);
                 indexCounts.push(tempVertexData.indices.length);
             }
             else {