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

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


  @Override
  public List<StructurePiece> getNextPieces() {
    final StructurePiece piece = getNextPiece();
    piece.setPosition(position.add(rotate(0, -5, 8)));
    piece.setRotation(rotation);
    piece.randomize();
    return Lists.newArrayList(piece);
  }

  @Override
  public BoundingBox getBoundingBox() {
View Full Code Here


      piece.setRotation(Quaternionf.fromAngleDegAxis(90, 0, 1, 0).mul(rotation));
    } else {
      piece.setPosition(position.add(rotate(-1, 0, 0)));
      piece.setRotation(Quaternionf.fromAngleDegAxis(-90, 0, 1, 0).mul(rotation));
    }
    piece.randomize();
    return Lists.newArrayList(piece);
  }

  @Override
  public BoundingBox getBoundingBox() {
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, 7)));
    front.setRotation(rotation);
    front.randomize();
    pieces.add(front);
    final StructurePiece right = getNextPiece();
    right.setPosition(position.add(rotate(-2, 0, 1)));
    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(-2, 0, 1)));
    right.setRotation(Quaternionf.fromAngleDegAxis(-90, 0, 1, 0).mul(rotation));
    right.randomize();
    pieces.add(right);
    final StructurePiece left = getNextPiece();
    left.setPosition(position.add(rotate(6, 0, 5)));
    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(6, 0, 5)));
    left.setRotation(Quaternionf.fromAngleDegAxis(90, 0, 1, 0).mul(rotation));
    left.randomize();
    pieces.add(left);
    return pieces;
  }

  @Override
View Full Code Here

    final Random random = getRandom();
    if (random.nextBoolean()) {
      final StructurePiece front = getNextPiece();
      front.setPosition(position.add(rotate(0, 0, depth)));
      front.setRotation(rotation);
      front.randomize();
      pieces.add(front);
    }
    if (random.nextBoolean()) {
      final StructurePiece right = getNextPiece();
      right.setPosition(position.add(rotate(xStart, 0, depth / 2)));
View Full Code Here

    }
    if (random.nextBoolean()) {
      final StructurePiece right = getNextPiece();
      right.setPosition(position.add(rotate(xStart, 0, depth / 2)));
      right.setRotation(Quaternionf.fromAngleDegAxis(-90, 0, 1, 0).mul(rotation));
      right.randomize();
      pieces.add(right);
    }
    if (random.nextBoolean()) {
      final StructurePiece left = getNextPiece();
      left.setPosition(position.add(rotate(xEnd, 0, depth / 2)));
View Full Code Here

    }
    if (random.nextBoolean()) {
      final StructurePiece left = getNextPiece();
      left.setPosition(position.add(rotate(xEnd, 0, depth / 2)));
      left.setRotation(Quaternionf.fromAngleDegAxis(90, 0, 1, 0).mul(rotation));
      left.randomize();
      pieces.add(left);
    }
    return pieces;
  }
View Full Code Here

  public List<StructurePiece> getNextPieces() {
    final List<StructurePiece> pieces = new ArrayList<StructurePiece>(2);
    final StructurePiece right = getNextPiece();
    right.setPosition(position.add(rotate(-2, 0, 0)));
    right.setRotation(Quaternionf.fromAngleDegAxis(-90, 0, 1, 0).mul(rotation));
    right.randomize();
    pieces.add(right);
    final StructurePiece left = getNextPiece();
    left.setPosition(position.add(rotate(7, 0, 4)));
    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(7, 0, 4)));
    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.