A ball has a min heihgt (for deformation)
This commit is contained in:
parent
9e605b0fec
commit
e80becdaee
2 changed files with 4 additions and 2 deletions
3
Ball.cpp
3
Ball.cpp
|
@ -2,10 +2,11 @@
|
|||
#include <iostream>
|
||||
#include <cmath>
|
||||
|
||||
Ball::Ball(Point& _center, double _v_x, double _p, double _q) :
|
||||
Ball::Ball(Point& _center, double _min_height, double _v_x, double _p, double _q) :
|
||||
Center(_center),
|
||||
surface(_center, _p, _q),
|
||||
init_h(_center.z),
|
||||
min_height(_min_height),
|
||||
bounce_number(0.0),
|
||||
crt_time(0),
|
||||
A(_center.z),
|
||||
|
|
3
Ball.hpp
3
Ball.hpp
|
@ -20,6 +20,7 @@ class Ball {
|
|||
Point Center;
|
||||
Spheroid surface;
|
||||
double init_h;
|
||||
double min_height;
|
||||
size_t bounce_number;
|
||||
double crt_time;
|
||||
double A, B, U, T; // Coefficients for the physical model.
|
||||
|
@ -31,7 +32,7 @@ class Ball {
|
|||
void _compute_U_n();
|
||||
void _compute_T_n();
|
||||
public:
|
||||
Ball(Point& _center, double _v_x, double p, double q);
|
||||
Ball(Point& _center, double _min_height, double _v_x, double p, double q);
|
||||
void update_pos(double dt);
|
||||
Point getCenter() const {return Center;}
|
||||
double accessT() const { return T;}
|
||||
|
|
Loading…
Reference in a new issue