No more glitch.
This commit is contained in:
parent
aafbd8ec9c
commit
75fc077007
1 changed files with 1 additions and 2 deletions
3
Ball.cpp
3
Ball.cpp
|
@ -29,7 +29,7 @@ void Ball::_compute_pos(double dt) {
|
||||||
if (bouncing) {
|
if (bouncing) {
|
||||||
Center.y = fmax(
|
Center.y = fmax(
|
||||||
min_height + height,
|
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 {
|
} else {
|
||||||
double n_time = crt_time - stop_bouncing;
|
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. *
|
(min_rad - ((min_rad* (1- exp(-n_time)) + min_rad)/2.)) * sin(5. *
|
||||||
n_time);
|
n_time);
|
||||||
}
|
}
|
||||||
std::cout << (*this) << "\n";
|
|
||||||
Center.x += dt * v_x;
|
Center.x += dt * v_x;
|
||||||
Center.z += dt * v_z;
|
Center.z += dt * v_z;
|
||||||
surface.update_center_pos(Center);
|
surface.update_center_pos(Center);
|
||||||
|
|
Loading…
Reference in a new issue