Package com.szuppe.jakub.common

Examples of com.szuppe.jakub.common.Coordinates2D


  /**
   * @return Współrzędne prawego-dolnego rogu.
   */
  public Coordinates2D getBottomRightCornerCoordinates()
  {
    return new Coordinates2D(
        (float) (topLeftCoordinates.getX() + dimension.getWidth()),
        (float) (topLeftCoordinates.getY() - dimension.getHeight()));
  }
View Full Code Here


  /**
   * @return Współrzędne lewego-dolnego rogu.
   */
  public Coordinates2D getBottomLeftCornerCoordinates()
  {
    return new Coordinates2D((float) (topLeftCoordinates.getX()),
        (float) (topLeftCoordinates.getY() - dimension.getHeight()));
  }
View Full Code Here

  /**
   * @return Współrzędne środka klocka.
   */
  public Coordinates2D getCenterCoordiantes()
  {
    return new Coordinates2D(
        (float) (topLeftCoordinates.getX() + dimension.getWidth() / 2),
        (float) (topLeftCoordinates.getY() - dimension.getHeight() / 2));
  }
View Full Code Here

   */
  private List<LineSegment2D> getBrickWithCirleCollisionLineSegments(final float radius)
  {
    List<LineSegment2D> brickLineSegments = new LinkedList<>();
    // spód
    Coordinates2D bottomStart = getBottomLeftCornerCoordinates().moveAlongVector(
        new Coordinates2D(0, -radius));
    Coordinates2D bottomEnd = getBottomRightCornerCoordinates().moveAlongVector(
        new Coordinates2D(0, -radius));
    brickLineSegments.add(new LineSegment2D(bottomStart, bottomEnd));
    // prawa ściana
    Coordinates2D rightSideStart = getBottomRightCornerCoordinates().moveAlongVector(
        new Coordinates2D(radius, 0));
    Coordinates2D rightSideEnd = getTopRightCornerCoordinates().moveAlongVector(
        new Coordinates2D(radius, 0));
    brickLineSegments.add(new LineSegment2D(rightSideStart, rightSideEnd));
    // wierzch
    Coordinates2D topStart = getTopRightCornerCoordinates().moveAlongVector(
        new Coordinates2D(0, radius));
    Coordinates2D topEnd = getTopLeftCornerCoordinates().moveAlongVector(
        new Coordinates2D(0, radius));
    brickLineSegments.add(new LineSegment2D(topStart, topEnd));
    // Lewa ściana przesunięte o radius na zewnątrz.
    Coordinates2D leftSideStart = getTopLeftCornerCoordinates().moveAlongVector(
        new Coordinates2D(-radius, 0));
    Coordinates2D leftSideEnd = getBottomLeftCornerCoordinates().moveAlongVector(
        new Coordinates2D(-radius, 0));
    brickLineSegments.add(new LineSegment2D(leftSideStart, leftSideEnd));
    // lewy-dolny róg
    brickLineSegments.add(new LineSegment2D(leftSideEnd, bottomStart));
    // prawy-dolny róg
    brickLineSegments.add(new LineSegment2D(bottomEnd, rightSideStart));
View Full Code Here

TOP

Related Classes of com.szuppe.jakub.common.Coordinates2D

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.