Package org.spout.vanilla.world.generator.structure

Examples of org.spout.vanilla.world.generator.structure.StructurePiece.randomize()


    final Random random = getRandom();
    if (random.nextBoolean()) {
      final StructurePiece bottomFront = getNextPiece();
      bottomFront.setPosition(position.add(rotate(0, 0, 5)));
      bottomFront.setRotation(rotation);
      bottomFront.randomize();
      pieces.add(bottomFront);
    }
    if (random.nextBoolean()) {
      final StructurePiece bottomRight = getNextPiece();
      bottomRight.setPosition(position.add(rotate(-1, 0, 1)));
View Full Code Here


    }
    if (random.nextBoolean()) {
      final StructurePiece bottomRight = getNextPiece();
      bottomRight.setPosition(position.add(rotate(-1, 0, 1)));
      bottomRight.setRotation(Quaternionf.fromAngleDegAxis(-90, 0, 1, 0).mul(rotation));
      bottomRight.randomize();
      pieces.add(bottomRight);
    }
    if (random.nextBoolean()) {
      final StructurePiece bottomLeft = getNextPiece();
      bottomLeft.setPosition(position.add(rotate(4, 0, 3)));
View Full Code Here

    }
    if (random.nextBoolean()) {
      final StructurePiece bottomLeft = getNextPiece();
      bottomLeft.setPosition(position.add(rotate(4, 0, 3)));
      bottomLeft.setRotation(Quaternionf.fromAngleDegAxis(90, 0, 1, 0).mul(rotation));
      bottomLeft.randomize();
      pieces.add(bottomLeft);
    }
    if (twoFloors && random.nextBoolean()) {
      final StructurePiece topFront = getNextPiece();
      topFront.setPosition(position.add(rotate(0, 4, 5)));
View Full Code Here

    }
    if (twoFloors && random.nextBoolean()) {
      final StructurePiece topFront = getNextPiece();
      topFront.setPosition(position.add(rotate(0, 4, 5)));
      topFront.setRotation(rotation);
      topFront.randomize();
      pieces.add(topFront);
    }
    if (twoFloors && random.nextBoolean()) {
      final StructurePiece topRight = getNextPiece();
      topRight.setPosition(position.add(rotate(-1, 4, 1)));
View Full Code Here

    }
    if (twoFloors && random.nextBoolean()) {
      final StructurePiece topRight = getNextPiece();
      topRight.setPosition(position.add(rotate(-1, 4, 1)));
      topRight.setRotation(Quaternionf.fromAngleDegAxis(-90, 0, 1, 0).mul(rotation));
      topRight.randomize();
      pieces.add(topRight);
    }
    if (twoFloors && random.nextBoolean()) {
      final StructurePiece topLeft = getNextPiece();
      topLeft.setPosition(position.add(rotate(4, 4, 3)));
View Full Code Here

    }
    if (twoFloors && random.nextBoolean()) {
      final StructurePiece topLeft = getNextPiece();
      topLeft.setPosition(position.add(rotate(4, 4, 3)));
      topLeft.setRotation(Quaternionf.fromAngleDegAxis(90, 0, 1, 0).mul(rotation));
      topLeft.randomize();
      pieces.add(topLeft);
    }
    if (twoFloors && random.nextBoolean()) {
      final StructurePiece topBack = getNextPiece();
      topBack.setPosition(position.add(rotate(2, 4, 0)));
View Full Code Here

    }
    if (twoFloors && random.nextBoolean()) {
      final StructurePiece topBack = getNextPiece();
      topBack.setPosition(position.add(rotate(2, 4, 0)));
      topBack.setRotation(Quaternionf.fromAngleDegAxis(180, 0, 1, 0).mul(rotation));
      topBack.randomize();
      pieces.add(topBack);
    }
    return pieces;
  }
View Full Code Here

  public List<StructurePiece> getNextPieces() {
    final List<StructurePiece> pieces = new ArrayList<StructurePiece>(3);
    final StructurePiece front = getNextPiece();
    front.setPosition(position.add(rotate(0, 0, 19)));
    front.setRotation(rotation);
    front.randomize();
    pieces.add(front);
    final StructurePiece right = getNextPiece();
    right.setPosition(position.add(rotate(-8, 0, 7)));
    right.setRotation(Quaternionf.fromAngleDegAxis(-90, 0, 1, 0).mul(rotation));
    right.randomize();
View Full Code Here

    front.randomize();
    pieces.add(front);
    final StructurePiece right = getNextPiece();
    right.setPosition(position.add(rotate(-8, 0, 7)));
    right.setRotation(Quaternionf.fromAngleDegAxis(-90, 0, 1, 0).mul(rotation));
    right.randomize();
    pieces.add(right);
    final StructurePiece left = getNextPiece();
    left.setPosition(position.add(rotate(12, 0, 11)));
    left.setRotation(Quaternionf.fromAngleDegAxis(90, 0, 1, 0).mul(rotation));
    left.randomize();
View Full Code Here

    right.randomize();
    pieces.add(right);
    final StructurePiece left = getNextPiece();
    left.setPosition(position.add(rotate(12, 0, 11)));
    left.setRotation(Quaternionf.fromAngleDegAxis(90, 0, 1, 0).mul(rotation));
    left.randomize();
    pieces.add(left);
    return pieces;
  }

  @Override
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.