return prophecy;
}
@Problem("do not ignore friction")
private void calculateBallPosition(){
DynamicObject ball = world.getBall();
if (ball.getSpeed() == null){
prophecy.setBallRelativePosition(agent.relativize(Vector3D.ZERO_VECTOR));
prophecy.setBallPosition(Vector3D.ZERO_VECTOR);
prophecy.setBallPositionRelativized(agent.relativize(Vector3D.ZERO_VECTOR));
return;
}
Vector3D whereItIsNow = ball.getSpeed().multiply(now - ball.getLastTimeSeen()).add(ball.getPosition());
Vector3D whereWillItBe = applyFriction(ball.getSpeed(), offset).add(whereItIsNow);
Vector3D whereWillItBeBasedOnRelativeSpeed = applyFriction(ball.getRelativeSpeed(), now - ball.getLastTimeSeen() + offset).add(ball.getRelativePosition());
prophecy.setBallPosition(whereWillItBe);
prophecy.setBallPositionRelativized(agent.relativize(whereWillItBe));
prophecy.setBallRelativePosition(whereWillItBeBasedOnRelativeSpeed);
}