title: Box2D libgdx polygon shape
body: <p>How come this works fine:</p>
  
  <pre><code>Vector2[] vertexArray = new Vector2[3];
  vertexArray[0] = new Vector2(0f, 0f);
  vertexArray[1] = new Vector2(1f, 1f);
  vertexArray[2] = new Vector2(2f, 5f);
  
  polygonShape.set(vertexArray);
  </code></pre>
  
  <p>and this gives a runtime error</p>
  
  <pre><code>Vector2[] vertexArray = new Vector2[3];
  vertexArray[0] = new Vector2(0f, 0f);
  vertexArray[1] = new Vector2(1f, 1f);
  vertexArray[2] = new Vector2(2f, 2f);
  
  polygonShape.set(vertexArray);
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>AL lib: (EE) alc_cleanup: 1 device not closed
  Assertion failed!
  
  Program: C:\Program Files\Java\jre1.8.0_25\bin\javaw.exe
  File: /var/lib/jenkins/workspace/libgdx/extensions/gdx-box2d/gdx-box2d/jni/Box2D/Collision/Shapes/b2PolygonShape.cpp, Line 223
  
  Expression: false
  </code></pre>
  
  <p>It does not make any sense. First code works fine and the triangle is drawn, but the second code does not. Can someone please explain what I'm doing wrong...</p>