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

Examples of org.spout.vanilla.world.generator.structure.StructurePiece$BoundingBox


  }

  @Override
  public List<StructurePiece> getNextPieces() {
    final List<StructurePiece> pieces = new ArrayList<StructurePiece>();
    final StructurePiece nextFront = getNextPiece();
    nextFront.setPosition(position.add(rotate(0, 0, 11)));
    nextFront.setRotation(rotation);
    nextFront.randomize();
    pieces.add(nextFront);
    final StructurePiece nextRight = getNextPiece();
    nextRight.setPosition(position.add(rotate(-4, 0, 3)));
    nextRight.setRotation(Quaternionf.fromAngleDegAxis(-90, 0, 1, 0).mul(rotation));
    nextRight.randomize();
    pieces.add(nextRight);
    final StructurePiece nextLeft = getNextPiece();
    nextLeft.setPosition(position.add(rotate(8, 0, 7)));
    nextLeft.setRotation(Quaternionf.fromAngleDegAxis(90, 0, 1, 0).mul(rotation));
    nextLeft.randomize();
    pieces.add(nextLeft);
    return pieces;
  }
View Full Code Here


  public void randomize() {
  }

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

  public void randomize() {
  }

  @Override
  public List<StructurePiece> getNextPieces() {
    final StructurePiece piece = getNextPiece();
    piece.setPosition(position.add(rotate(0, 0, 7)));
    piece.setRotation(rotation);
    piece.randomize();
    return Lists.newArrayList(piece);
  }
View Full Code Here

  @Override
  public List<StructurePiece> getNextPieces() {
    final List<StructurePiece> pieces = new ArrayList<StructurePiece>();
    if (startOfStronghold) {
      final StructurePiece piece = new StrongholdPortalRoom(parent);
      piece.setPosition(position.add(rotate(4, 0, -1)));
      piece.setRotation(Quaternionf.fromAngleDegAxis(180, 0, 1, 0).mul(rotation));
      piece.randomize();
      pieces.add(piece);
    }
    final StructurePiece piece = getNextPiece();
    piece.setPosition(position.add(rotate(0, 0, length)));
    piece.setRotation(rotation);
    piece.randomize();
    pieces.add(piece);
    return pieces;
  }
View Full Code Here

  }

  @Override
  public List<StructurePiece> getNextPieces() {
    final List<StructurePiece> pieces = new ArrayList<StructurePiece>();
    final StructurePiece piece = getNextPiece();
    piece.setPosition(position.add(rotate(1, -2, 11)));
    piece.setRotation(rotation);
    piece.randomize();
    pieces.add(piece);
    if (nextComponentRightLow) {
      final StructurePiece next = getNextPiece();
      next.setPosition(position.add(rotate(-4, 0, 0)));
      next.setRotation(Quaternionf.fromAngleDegAxis(-90, 0, 1, 0).mul(rotation));
      next.randomize();
      pieces.add(next);
    }
    if (nextComponentRightHigh) {
      final StructurePiece next = getNextPiece();
      next.setPosition(position.add(rotate(-4, 2, 6)));
      next.setRotation(Quaternionf.fromAngleDegAxis(-90, 0, 1, 0).mul(rotation));
      next.randomize();
      pieces.add(next);
    }
    if (nextComponentLeftLow) {
      final StructurePiece next = getNextPiece();
      next.setPosition(position.add(rotate(7, 0, 4)));
      next.setRotation(Quaternionf.fromAngleDegAxis(90, 0, 1, 0).mul(rotation));
      next.randomize();
      pieces.add(next);
    }
    if (nextComponentLeftHigh) {
      final StructurePiece next = getNextPiece();
      next.setPosition(position.add(rotate(7, 2, 10)));
      next.setRotation(Quaternionf.fromAngleDegAxis(90, 0, 1, 0).mul(rotation));
      next.randomize();
      pieces.add(next);
    }
    return pieces;
  }
View Full Code Here

  public void randomize() {
  }

  @Override
  public List<StructurePiece> getNextPieces() {
    final StructurePiece piece = getNextPiece();
    piece.setPosition(position.add(rotate(6, 6, 5)));
    piece.setRotation(Quaternionf.fromAngleDegAxis(90, 0, 1, 0).mul(rotation));
    piece.randomize();
    return Lists.newArrayList(piece);
  }
View Full Code Here

  public void randomize() {
  }

  @Override
  public List<StructurePiece> getNextPieces() {
    final StructurePiece piece = getNextPiece();
    piece.setPosition(position.add(rotate(0, 0, 11)));
    piece.setRotation(rotation);
    piece.randomize();
    return Lists.newArrayList(piece);
  }
View Full Code Here

  }

  @Override
  public List<StructurePiece> getNextPieces() {
    final List<StructurePiece> pieces = new ArrayList<StructurePiece>();
    final StructurePiece piece = getNextPiece();
    piece.setPosition(position.add(rotate(0, 0, 7)));
    piece.setRotation(rotation);
    piece.randomize();
    pieces.add(piece);
    if (nextComponentRight) {
      final StructurePiece next = getNextPiece();
      next.setPosition(position.add(rotate(-1, 0, 1)));
      next.setRotation(Quaternionf.fromAngleDegAxis(-90, 0, 1, 0).mul(rotation));
      next.randomize();
      pieces.add(next);
    }
    if (nextComponentLeft) {
      final StructurePiece next = getNextPiece();
      next.setPosition(position.add(rotate(5, 0, 5)));
      next.setRotation(Quaternionf.fromAngleDegAxis(90, 0, 1, 0).mul(rotation));
      next.randomize();
      pieces.add(next);
    }
    return pieces;
  }
View Full Code Here

    corridor.randomize();
    activeBranches.add(corridor);
    final int size = random.nextInt(MAX_SIZE_RAND + 1) + MAX_SIZE_BASE;
    byte count = 0;
    while (!activeBranches.isEmpty()) {
      final StructurePiece active = activeBranches.poll();
      final BoundingBox activeBox = active.getBoundingBox();
      if (!collides(activeBox, lastBoxes.remove(active), placed) && active.canPlace()
          && active.getPosition().getY() >= 10) {
        active.place();
        if (++count > size) {
          return;
        }
        placed.add(activeBox);
        final List<StructurePiece> next = active.getNextPieces();
        for (StructurePiece piece : next) {
          lastBoxes.put(piece, activeBox);
        }
        activeBranches.addAll(next);
      }
View Full Code Here

TOP

Related Classes of org.spout.vanilla.world.generator.structure.StructurePiece$BoundingBox

Copyright © 2018 www.massapicom. 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.