From afc7b4a3b919f6ab75e0e9bd346654afc3b2167f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Oudin?= Date: Tue, 13 Feb 2018 12:46:47 +0100 Subject: [PATCH] reduction of speed on x and z axis --- Ball.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Ball.cpp b/Ball.cpp index 9cef020..5e431b0 100644 --- a/Ball.cpp +++ b/Ball.cpp @@ -33,6 +33,8 @@ void Ball::_compute_pos(double dt) { double n_time = crt_time - stop_bouncing; Center.y = ((radius * (1.0 - exp(-n_time)) + radius)/2.) + (radius - ((radius * (1- exp(-n_time)) + radius)/2.)) * sin(5. * n_time); + v_x *= 0.99; + v_z *= 0.99; } Center.x += dt * v_x; Center.z += dt * v_z;