Project

General

Profile

« Previous | Next » 

Revision 7e9a35eb

Added by Leszek Koltunski 11 months ago

change the way the coordinates of stickers are kept from float[2*N] to float[N][2]

View differences:

src/main/java/org/distorted/objectlib/json/JsonReader.java
358 358
      JSONArray vertices = sticker.getJSONArray("vertices");
359 359
      int numVertices = vertices.length();
360 360

  
361
      float[] coords     = new float[2*numVertices];
361
      float[][] coords   = new float[numVertices][2];
362 362
      float[] curvatures = new float[numVertices];
363 363
      float[] radii      = new float[numVertices];
364 364

  
......
366 366
        {
367 367
        JSONObject vertex = vertices.getJSONObject(j);
368 368

  
369
        coords[2*j  ] = (float)vertex.getDouble("x");
370
        coords[2*j+1] = (float)vertex.getDouble("y");
369
        coords[j][0]  = (float)vertex.getDouble("x");
370
        coords[j][1]  = (float)vertex.getDouble("y");
371 371
        curvatures[j] = (float)vertex.getDouble("angle");
372 372
        radii[j]      = (float)vertex.getDouble("radius");
373 373
        }

Also available in: Unified diff