A height shouldn't be negative.
This commit is contained in:
parent
dfbaa80e03
commit
61933b9b78
1 changed files with 1 additions and 1 deletions
2
Ball.cpp
2
Ball.cpp
|
@ -17,7 +17,7 @@ Ball::Ball(Point& _center, double _v_x, double _p, double _q) :
|
|||
}
|
||||
|
||||
void Ball::_compute_pos(double dt) {
|
||||
Center.z = A + B * crt_time - (G_CTE / 2) * crt_time * crt_time;
|
||||
Center.z = fmax(0.0, A + B * crt_time - (G_CTE / 2) * crt_time * crt_time);
|
||||
Center.x += dt * v_x;
|
||||
surface.update_center_pos(Center);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue