No more glitch.

This commit is contained in:
Rémi Oudin 2018-02-13 18:26:18 +01:00
parent aafbd8ec9c
commit 75fc077007

View file

@ -29,7 +29,7 @@ void Ball::_compute_pos(double dt) {
if (bouncing) {
Center.y = fmax(
min_height + height,
A + B * crt_time - (G_CTE / 2) * crt_time * crt_time + min_height + height
A + B * crt_time - (G_CTE / 2) * crt_time * crt_time + min_height
);
} else {
double n_time = crt_time - stop_bouncing;
@ -40,7 +40,6 @@ void Ball::_compute_pos(double dt) {
(min_rad - ((min_rad* (1- exp(-n_time)) + min_rad)/2.)) * sin(5. *
n_time);
}
std::cout << (*this) << "\n";
Center.x += dt * v_x;
Center.z += dt * v_z;
surface.update_center_pos(Center);