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 <iostream>
|
||||||
#include <cmath>
|
#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),
|
Center(_center),
|
||||||
surface(_center, _p, _q),
|
surface(_center, _p, _q),
|
||||||
init_h(_center.z),
|
init_h(_center.z),
|
||||||
|
min_height(_min_height),
|
||||||
bounce_number(0.0),
|
bounce_number(0.0),
|
||||||
crt_time(0),
|
crt_time(0),
|
||||||
A(_center.z),
|
A(_center.z),
|
||||||
|
|
3
Ball.hpp
3
Ball.hpp
|
@ -20,6 +20,7 @@ class Ball {
|
||||||
Point Center;
|
Point Center;
|
||||||
Spheroid surface;
|
Spheroid surface;
|
||||||
double init_h;
|
double init_h;
|
||||||
|
double min_height;
|
||||||
size_t bounce_number;
|
size_t bounce_number;
|
||||||
double crt_time;
|
double crt_time;
|
||||||
double A, B, U, T; // Coefficients for the physical model.
|
double A, B, U, T; // Coefficients for the physical model.
|
||||||
|
@ -31,7 +32,7 @@ class Ball {
|
||||||
void _compute_U_n();
|
void _compute_U_n();
|
||||||
void _compute_T_n();
|
void _compute_T_n();
|
||||||
public:
|
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);
|
void update_pos(double dt);
|
||||||
Point getCenter() const {return Center;}
|
Point getCenter() const {return Center;}
|
||||||
double accessT() const { return T;}
|
double accessT() const { return T;}
|
||||||
|
|
Loading…
Reference in a new issue