Beispiel #1
0
  private void build() {
    color = new Color4();
    faces = new Rectangle[6];
    Rectangle north = new Rectangle(size, size, quality, quality, color);
    Rectangle east = new Rectangle(size, size, quality, quality, color);
    Rectangle south = new Rectangle(size, size, quality, quality, color);
    Rectangle west = new Rectangle(size, size, quality, quality, color);
    Rectangle up = new Rectangle(size, size, quality, quality, color);
    Rectangle down = new Rectangle(size, size, quality, quality, color);

    north.position().z = halfSize;
    north.lightingEnabled(false);

    east.rotation().y = -90;
    east.position().x = halfSize;
    east.doubleSidedEnabled(true);
    east.lightingEnabled(false);

    south.rotation().y = 180;
    south.position().z = -halfSize;
    south.lightingEnabled(false);

    west.rotation().y = 90;
    west.position().x = -halfSize;
    west.doubleSidedEnabled(true);
    west.lightingEnabled(false);

    up.rotation().x = 90;
    up.position().y = halfSize;
    up.doubleSidedEnabled(true);
    up.lightingEnabled(false);

    down.rotation().x = -90;
    down.position().y = -halfSize;
    down.doubleSidedEnabled(true);
    down.lightingEnabled(false);

    faces[Face.North.ordinal()] = north;
    faces[Face.East.ordinal()] = east;
    faces[Face.South.ordinal()] = south;
    faces[Face.West.ordinal()] = west;
    faces[Face.Up.ordinal()] = up;
    faces[Face.Down.ordinal()] = down;

    addChild(north);
    addChild(east);
    addChild(south);
    addChild(west);
    addChild(up);
    addChild(down);
  }