浏览代码

*Modified computeNumElements to support n-Patches

michael 10 年之前
父节点
当前提交
19143def9b
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9 0
      jme3-core/src/main/java/com/jme3/scene/Mesh.java

+ 9 - 0
jme3-core/src/main/java/com/jme3/scene/Mesh.java

@@ -733,6 +733,8 @@ public class Mesh implements Savable, Cloneable {
                 return bufSize;
                 return bufSize;
             case LineStrip:
             case LineStrip:
                 return bufSize - 1;
                 return bufSize - 1;
+            case Patch:
+                return bufSize/patchVertexCount;
             default:
             default:
                 throw new UnsupportedOperationException();
                 throw new UnsupportedOperationException();
         }
         }
@@ -1367,6 +1369,13 @@ public class Mesh implements Savable, Cloneable {
                getBuffer(Type.HWBoneIndex) != null;
                getBuffer(Type.HWBoneIndex) != null;
     }
     }
 
 
+    /**
+     * Sets the count of vertics used for each tessellation patch
+     * @param patchVertexCount
+     */
+    public void setPatchVertexCount(int patchVertexCount) {
+        this.patchVertexCount = patchVertexCount;
+    }
 
 
     public void write(JmeExporter ex) throws IOException {
     public void write(JmeExporter ex) throws IOException {
         OutputCapsule out = ex.getCapsule(this);
         OutputCapsule out = ex.getCapsule(this);