The following code only draws the circle at the last position in the updatedPoints vector2 arraylist. It does not draw a circle at all of the positions being iterated. Why not and how can i fix it?
shapeRenderer.setProjectionMatrix(camera.combined);
shapeRenderer.begin(ShapeType.Filled);
if(drawnBodies.size()>0){
for(int i = 0;i<updatedPoints.size();i++)
{
shapeRenderer.setColor(1, 1, 0, 1);
//shapeRenderer.line(bodyPoints.get(z).x,bodyPoints.get(z).y,updatedPoints.get(z+1).x,updatedPoints.get(z+1).y);
shapeRenderer.circle(updatedPoints.get(i).x, updatedPoints.get(i).y, 1);
//shapeRenderer.line(car.getChassis().getPosition(),bodyPoints.get(0));
}
}
shapeRenderer.end();
Aucun commentaire:
Enregistrer un commentaire