How come this works fine:
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);
and this gives a runtime error
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);
Error:
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
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...