diff --git a/Ball.cpp b/Ball.cpp index 5e431b0..aa478cf 100644 --- a/Ball.cpp +++ b/Ball.cpp @@ -70,7 +70,7 @@ void Ball::_compute_v_z(Point normal) { void Ball::update_pos(double dt) { crt_time += dt; - if (crt_time >= T) { + if ((bouncing) && (crt_time >= T)) { double old_t = T; double max_t; Point normal = surface.getNormalVector(); @@ -83,7 +83,7 @@ void Ball::update_pos(double dt) { _compute_v_z(normal); max_t = (T - old_t)/2.0 + old_t; - if ((bouncing) && ((A + B * max_t - (G_CTE / 2) * max_t * max_t + min_height) < radius)) { + if (((A + B * max_t - (G_CTE / 2) * max_t * max_t + min_height) < radius)) { stop_bouncing = crt_time; bouncing = false; }