OSDN Git Service

fixed vertices and indices ensuring
authorVinceAngel <vinceangel3d@gmail.com>
Wed, 9 Oct 2013 21:29:24 +0000 (23:29 +0200)
committerVinceAngel <vinceangel3d@gmail.com>
Wed, 9 Oct 2013 21:29:24 +0000 (23:29 +0200)
gdx/src/com/badlogic/gdx/graphics/g3d/utils/MeshBuilder.java

index 304ded4..18388d5 100644 (file)
@@ -705,11 +705,12 @@ public class MeshBuilder implements MeshPartBuilder {
                }
                else if (innerWidth == width && innerHeight == height){
                        ensureVertices(divisions + 1);
+                       ensureIndices(divisions + 1);
                        if(primitiveType != GL10.GL_LINES)
                                throw new GdxRuntimeException("Incorrect primitive type : expect GL_LINES because innerWidth == width && innerHeight == height");
                }
                else {
-                       ensureRectangleIndices(divisions + 1);
+                       ensureRectangles((divisions + 1)*2, divisions + 1);
                }
                
                final float ao = MathUtils.degreesToRadians * angleFrom;