From 1ddb7903db7c4126691bc0f771d524320e1a2a0f Mon Sep 17 00:00:00 2001 From: "Sha..rd" Date: Fri, 14 Sep 2012 05:21:21 +0000 Subject: [PATCH] * OBJ loader now supports loading models that use negative indices in the face statement git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9724 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../core-plugins/com/jme3/scene/plugins/OBJLoader.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/engine/src/core-plugins/com/jme3/scene/plugins/OBJLoader.java b/engine/src/core-plugins/com/jme3/scene/plugins/OBJLoader.java index 27efc007f..64a0e582e 100644 --- a/engine/src/core-plugins/com/jme3/scene/plugins/OBJLoader.java +++ b/engine/src/core-plugins/com/jme3/scene/plugins/OBJLoader.java @@ -255,6 +255,16 @@ public final class OBJLoader implements AssetLoader { v = Integer.parseInt(split[0].trim()); vn = Integer.parseInt(split[2].trim()); } + + if (v < 0) { + v = verts.size() + v + 1; + } + if (vt < 0) { + vt = texCoords.size() + vt + 1; + } + if (vn < 0) { + vn = norms.size() + vn + 1; + } Vertex vx = new Vertex(); vx.v = verts.get(v - 1);