A height shouldn't be negative.

This commit is contained in:
Rémi Oudin 2018-02-12 10:48:26 +01:00
parent dfbaa80e03
commit 61933b9b78

View file

@ -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);
}