final List<Coordinates2D> verticesList = verticles.getVerticesList();
try
{
// TOP CHECK
final Coordinates2D paddleLeftTopCo = verticesList.get(1).moveAlongVector(
new Coordinates2D(0, radius));
final Coordinates2D paddleRightTopCo = verticesList.get(2).moveAlongVector(
new Coordinates2D(0, radius));
Line2D paddleTop = new Line2D(paddleLeftTopCo, paddleRightTopCo);
Coordinates2D pointOfIntersection = paddleTop
.intersectionPoint(ballMovementRay);
double distance = Math.sqrt(Math.pow(
pointOfIntersection.getX() - ball.getX(), 2)
+ Math.pow(pointOfIntersection.getY() - ball.getY(), 2));
long timeTillCollision = (long) (distance / ballSpeed.getSpeedValue());
Coordinates2D displacementFromVelocity = speed.countDisplacement(timeTillCollision);
Coordinates2D displacementFromAcc = acceleration.countDisplacement(timeTillCollision);
Coordinates2D displacement = displacementFromVelocity
.moveAlongVector(displacementFromAcc);
final Coordinates2D paddleLeftTopCoAfterTime = paddleLeftTopCo
.moveAlongVector(displacement);
final Coordinates2D paddleRightTopCoAfterTime = paddleRightTopCo
.moveAlongVector(displacement);
if (paddleLeftTopCoAfterTime.getX() <= pointOfIntersection.getX()
&& pointOfIntersection.getX() <= paddleRightTopCoAfterTime.getX())
{
collisionList.add(new BallWithPaddleCollision(timeTillCollision));
}
// END TOP CHECK
} catch (DoesnotIntersectException e)