From c8a2a7260eda427498a8b551a20eb52696c14962 Mon Sep 17 00:00:00 2001 From: shadowislord Date: Wed, 12 Nov 2014 22:03:57 -0500 Subject: [PATCH] Correct the previous PR a bit * Support 1D and 3D texture coordinates specified by ogre exporter as well as 2D --- .../ogre/java/com/jme3/scene/plugins/ogre/MeshLoader.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/MeshLoader.java b/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/MeshLoader.java index c140da061..6c2615823 100644 --- a/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/MeshLoader.java +++ b/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/MeshLoader.java @@ -429,7 +429,11 @@ public class MeshLoader extends DefaultHandler implements AssetLoader { int texCoords = parseInt(attribs.getValue("texture_coords"), 0); for (int i = 0; i < texCoords; i++) { - int dims = parseInt(attribs.getValue("texture_coord_dimensions_" + i).replaceAll("float2", "2"), 2); + String dimsStr = attribs.getValue("texture_coord_dimensions_" + i); + if (dimsStr.startsWith("float")) { + dimsStr = dimsStr.substring("float".length()); + } + int dims = parseInt(dimsStr, 2); if (dims < 1 || dims > 4) { throw new SAXException("Texture coord dimensions must be 1 <= dims <= 4"); }