Update spheroid if conflict with a plan at a given height.

This commit is contained in:
Rémi Oudin 2018-02-09 20:23:06 +01:00
parent bf3232d790
commit 9ef21a2dc9
2 changed files with 9 additions and 0 deletions

View file

@ -26,3 +26,11 @@ void Spheroid::update_radius() {
void Spheroid::update_center_pos(Point& _center) {
center = _center;
}
void Spheroid::check_plan_collision(double& height) {
if ((center.z - p) <= height) {
p = center.z-height;
update_radius();
}
}

View file

@ -16,6 +16,7 @@ class Spheroid : public ImplicitSurface {
void update_center_pos(Point& _center);
void update_radius();
void set_stiffness(size_t _stiffness);
void check_plan_collision(double& height);
double operator() (double _x, double _y, double _z) {
return (pow(_x - center.x, 2) / pow(q, 2)
+ pow(_y - center.y, 2) / pow(q, 2)