From 5468a48050d2cac1a31ce0085995d200b538049c Mon Sep 17 00:00:00 2001 From: Teencrusher Date: Thu, 3 Mar 2016 13:23:04 -0500 Subject: [PATCH 1/2] Removed the modification of the input parameter that lead to a wrong axisSamples member then the cylinder was closed --- jme3-core/src/main/java/com/jme3/scene/shape/Cylinder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jme3-core/src/main/java/com/jme3/scene/shape/Cylinder.java b/jme3-core/src/main/java/com/jme3/scene/shape/Cylinder.java index 1d215eb6b..6fde33c0e 100644 --- a/jme3-core/src/main/java/com/jme3/scene/shape/Cylinder.java +++ b/jme3-core/src/main/java/com/jme3/scene/shape/Cylinder.java @@ -211,7 +211,7 @@ public class Cylinder extends Mesh { */ public void updateGeometry(int axisSamples, int radialSamples, float radius, float radius2, float height, boolean closed, boolean inverted) { - this.axisSamples = axisSamples + (closed ? 2 : 0); + this.axisSamples = axisSamples; this.radialSamples = radialSamples; this.radius = radius; this.radius2 = radius2; From b431d16981980ea8d9dd78e1e03ebe0559eca008 Mon Sep 17 00:00:00 2001 From: Kirill Vainer Date: Fri, 4 Mar 2016 19:51:18 -0500 Subject: [PATCH 2/2] Cylinder: fix incorrect axis samples for closed --- jme3-core/src/main/java/com/jme3/scene/shape/Cylinder.java | 1 + 1 file changed, 1 insertion(+) diff --git a/jme3-core/src/main/java/com/jme3/scene/shape/Cylinder.java b/jme3-core/src/main/java/com/jme3/scene/shape/Cylinder.java index 6fde33c0e..1e0b1cae2 100644 --- a/jme3-core/src/main/java/com/jme3/scene/shape/Cylinder.java +++ b/jme3-core/src/main/java/com/jme3/scene/shape/Cylinder.java @@ -222,6 +222,7 @@ public class Cylinder extends Mesh { // VertexBuffer pvb = getBuffer(Type.Position); // VertexBuffer nvb = getBuffer(Type.Normal); // VertexBuffer tvb = getBuffer(Type.TexCoord); + axisSamples += (closed ? 2 : 0); // Vertices int vertCount = axisSamples * (radialSamples + 1) + (closed ? 2 : 0);