From 93530bc2d003e317743cdd4c2795ab74375e4354 Mon Sep 17 00:00:00 2001 From: "Kae..pl" Date: Tue, 26 Jul 2011 11:41:10 +0000 Subject: [PATCH] Fix to loading models with high number of vertices (greater than Shor.MAX_VALUE). git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7923 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../scene/plugins/blender/helpers/v249/MeshHelper.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/src/blender/com/jme3/scene/plugins/blender/helpers/v249/MeshHelper.java b/engine/src/blender/com/jme3/scene/plugins/blender/helpers/v249/MeshHelper.java index 6350e5332..aacec0570 100644 --- a/engine/src/blender/com/jme3/scene/plugins/blender/helpers/v249/MeshHelper.java +++ b/engine/src/blender/com/jme3/scene/plugins/blender/helpers/v249/MeshHelper.java @@ -304,13 +304,13 @@ public class MeshHelper extends AbstractBlenderHelper { // creating vertices indices for this mesh List indexList = meshEntry.getValue(); - short[] indices = new short[indexList.size()];//TODO: check if the model doesn't have more than 32767 vertices - for (int i = 0; i < indexList.size(); ++i) {//if yes then mesh.getVertices method must be changed to accept other than ShortBuffer - indices[i] = indexList.get(i).shortValue(); + int[] indices = new int[indexList.size()]; + for (int i = 0; i < indexList.size(); ++i) { + indices[i] = indexList.get(i).intValue(); } // setting vertices - mesh.setBuffer(Type.Index, 1, BufferUtils.createShortBuffer(indices)); + mesh.setBuffer(Type.Index, 1, indices); mesh.setBuffer(verticesBuffer); mesh.setBuffer(verticesBind);