Пример #1
0
 private void writeElement(BufferedWriter writer, Element cuboid) throws IOException {
   writer.write(space(3) + "\"name\": \"" + cuboid.toString() + "\",");
   writer.newLine();
   writeBounds(writer, cuboid);
   writer.newLine();
   if (!cuboid.isShaded()) {
     writeShade(writer, cuboid);
     writer.newLine();
   }
   if (cuboid.getRotation() != 0) {
     writeRotation(writer, cuboid);
     writer.newLine();
   }
   writeFaces(writer, cuboid);
 }
Пример #2
0
 private void writeRotation(BufferedWriter writer, Element cuboid) throws IOException {
   writer.write(space(3) + "\"rotation\": { ");
   writer.write(
       "\"origin\": [ "
           + numToString(cuboid.getOriginX())
           + ", "
           + numToString(cuboid.getOriginY())
           + ", "
           + numToString(cuboid.getOriginZ())
           + " ], ");
   writer.write("\"axis\": \"" + Element.parseAxis(cuboid.getPrevAxis()) + "\", ");
   writer.write("\"angle\": " + numToString(cuboid.getRotation()));
   if (cuboid.shouldRescale()) {
     writer.write(", \"rescale\": " + cuboid.shouldRescale());
   }
   writer.write(" },");
 }