瀏覽代碼

* Fixed bug with OgreXML loader not actually supporting 2nd UV channel

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7132 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
sha..rd 14 年之前
父節點
當前提交
8adc704bcc
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      engine/src/ogre/com/jme3/scene/plugins/ogre/MeshLoader.java

+ 4 - 2
engine/src/ogre/com/jme3/scene/plugins/ogre/MeshLoader.java

@@ -443,9 +443,11 @@ public class MeshLoader extends DefaultHandler implements AssetLoader {
 
 
     private void pushTexCoord(Attributes attribs) throws SAXException{
     private void pushTexCoord(Attributes attribs) throws SAXException{
         if (texCoordIdx >= 1)
         if (texCoordIdx >= 1)
-            return; // TODO: Support multi-texcoords
+            return; // TODO: More than 2 texcoords
+
+        Type type = texCoordIdx == 0 ? Type.TexCoord : Type.TexCoord2;
         
         
-        VertexBuffer tcvb = mesh.getBuffer(Type.TexCoord);
+        VertexBuffer tcvb = mesh.getBuffer(type);
         FloatBuffer buf = (FloatBuffer) tcvb.getData();
         FloatBuffer buf = (FloatBuffer) tcvb.getData();
 
 
         buf.put(parseFloat(attribs.getValue("u")));
         buf.put(parseFloat(attribs.getValue("u")));