From 19143def9b478822b70f2edae9bc0c9c48af6aa1 Mon Sep 17 00:00:00 2001 From: michael Date: Sat, 28 Feb 2015 12:54:38 +0100 Subject: [PATCH] *Modified computeNumElements to support n-Patches --- jme3-core/src/main/java/com/jme3/scene/Mesh.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/jme3-core/src/main/java/com/jme3/scene/Mesh.java b/jme3-core/src/main/java/com/jme3/scene/Mesh.java index 357cee438..3f074f091 100644 --- a/jme3-core/src/main/java/com/jme3/scene/Mesh.java +++ b/jme3-core/src/main/java/com/jme3/scene/Mesh.java @@ -733,6 +733,8 @@ public class Mesh implements Savable, Cloneable { return bufSize; case LineStrip: return bufSize - 1; + case Patch: + return bufSize/patchVertexCount; default: throw new UnsupportedOperationException(); } @@ -1367,6 +1369,13 @@ public class Mesh implements Savable, Cloneable { 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 { OutputCapsule out = ex.getCapsule(this);