Package com.szuppe.jakub.common

Examples of com.szuppe.jakub.common.Acceleration2D


        + (0.5f * acceleration.getyAcc() * timeInterval * timeInterval);
    if (Math.abs(speed.getXSpeed()) < Math.abs(0.5f * acceleration.getxAcc() * timeInterval)
        || Math.abs(speed.getYSpeed()) < Math.abs(0.5f * acceleration.getyAcc() * timeInterval))
    {
      speed = new SpeedVector2D(0, 0);
      acceleration = new Acceleration2D(0, 0);
      ballDisplacementVector = new Coordinates2D(0, 0);
    }
    else
    {
      ballDisplacementVector = new Coordinates2D(xballDisplacement, yballDisplacement);
View Full Code Here


  {
    Coordinates2D correctedPaddleCoordinates = new Coordinates2D(paddleMockup.getX(), levelHeight
        - paddleMockup.getY());
    SpeedVector2D correctedSpeed = paddleMockup.getSpeed();
    correctedSpeed.reverseYSpeed();
    Acceleration2D correctedAcceleration = paddleMockup.getRetardation();
    correctedAcceleration.reverseYAcc();
    PaddleMockup correctedPaddleMockup = new PaddleMockup(correctedPaddleCoordinates, correctedSpeed,
        correctedAcceleration);
    return correctedPaddleMockup;
  }
View Full Code Here

  private BallMockup correctBallMockup(BallMockup ballMockup, float levelHeight)
  {
    Coordinates2D correctedBallCoordinates = new Coordinates2D(ballMockup.getX(), levelHeight - ballMockup.getY());
    SpeedVector2D correctedSpeed = ballMockup.getSpeed();
    correctedSpeed.reverseYSpeed();
    Acceleration2D correctedAcceleration = ballMockup.getAcceleration();
    correctedAcceleration.reverseYAcc();
    BallMockup correctedBallMockup = new BallMockup(correctedBallCoordinates, ballMockup.getRadius(),
        correctedSpeed, correctedAcceleration);
    return correctedBallMockup;
  }
View Full Code Here

  /**
   * @return Wektor przyspieszenia.
   */
  public Acceleration2D getRetardation()
  {
    return new Acceleration2D(retardation);
  }
View Full Code Here

   */
  public Paddle(PaddleConfig paddleConfig)
  {
    this.paddleConfig = paddleConfig;
    this.speed = new SpeedVector2D(0, 0);
    this.acceleration = new Acceleration2D(0, 0);
    this.verticles = new Vertices2D(paddleConfig.getStartVertices());
  }
View Full Code Here

  /**
   * @return Przyspieszenie.
   */
  public Acceleration2D getAcceleration()
  {
    return new Acceleration2D(acceleration);
  }
View Full Code Here

  /**
   * @return Opóźnienie platformy.
   */
  public Acceleration2D getAbsRetardation()
  {
    return new Acceleration2D(absRetardation);
  }
View Full Code Here

    this.ballConfig = ballConfig;
    this.ballState = BallState.GLUED_TO_PADDLE;
    this.coordinates = ballConfig.getStartCoordinates();
    this.radius = ballConfig.getRadius();
    this.speed = new SpeedVector2D(0, 0);
    this.acceleration = new Acceleration2D(0, 0);
  }
View Full Code Here

  private List<Collision> checkCollisionsWithPaddle()
  {
    List<Collision> collisionsList = new LinkedList<>();
    final SpeedVector2D paddleSpeed = paddle.getSpeed();
    final float paddleXSpeed = paddleSpeed.getXSpeed();
    final Acceleration2D paddleAcc = paddle.getAcceleration();
    final float paddleXAcc = paddleAcc.getxAcc();

    if (paddleXSpeed == 0 || paddleXAcc == 0)
    {
      return Collections.emptyList();
    }
View Full Code Here

TOP

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

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.