From 7b2f1094b14b481f39a375039f5bfe0808dbe829 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Re=CC=81my=20Bouquet?= Date: Sun, 24 Sep 2017 15:55:46 +0200 Subject: [PATCH] Gltf fix data reading --- .../src/gltf/java/com/jme3/scene/plugins/gltf/GltfLoader.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jme3-plugins/src/gltf/java/com/jme3/scene/plugins/gltf/GltfLoader.java b/jme3-plugins/src/gltf/java/com/jme3/scene/plugins/gltf/GltfLoader.java index a97d40017..ca9d03726 100644 --- a/jme3-plugins/src/gltf/java/com/jme3/scene/plugins/gltf/GltfLoader.java +++ b/jme3-plugins/src/gltf/java/com/jme3/scene/plugins/gltf/GltfLoader.java @@ -367,6 +367,7 @@ public class GltfLoader implements AssetLoader { buffs.weights = readAccessorData(entry.getValue().getAsInt(), new FloatArrayPopulator()); } else { VertexBuffer vb = readAccessorData(entry.getValue().getAsInt(), new VertexBufferPopulator(getVertexBufferType(bufferType))); + System.err.println(bufferType); if (vb != null) { mesh.setBuffer(vb); } @@ -527,7 +528,8 @@ public class GltfLoader implements AssetLoader { BinDataKey key = new BinDataKey(info.getKey().getFolder() + uri); InputStream input = (InputStream) info.getManager().loadAsset(key); data = new byte[bufferLength]; - input.read(data); + DataInputStream dataStream = new DataInputStream(input); + dataStream.readFully(data); } } else { //no URI this should not happen in a gltf file, only in glb files.