keep track of initial radius, for deformation
This commit is contained in:
parent
19cb1eb343
commit
0f70e4e023
2 changed files with 3 additions and 3 deletions
|
@ -5,7 +5,7 @@
|
|||
#include "spheroid.hpp"
|
||||
|
||||
Spheroid::Spheroid(Point& _center, size_t _p, size_t _q) :
|
||||
ImplicitSurface(_center), p(_p), q(_q), stiffness(0) {
|
||||
ImplicitSurface(_center), init_p(_p), p(_p), q(_q), stiffness(0) {
|
||||
_compute_volume();
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ void Spheroid::update_center_pos(Point& _center) {
|
|||
|
||||
void Spheroid::check_horizontal_plan_collision(double& height) {
|
||||
if ((center.z - p) <= height) {
|
||||
p = center.z-height;
|
||||
p = fmin(init_p, center.z-height);
|
||||
update_radius();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ class Spheroid : public ImplicitSurface {
|
|||
* V is the volume. Extremely useful to have a constant volume in the
|
||||
* ball
|
||||
**/
|
||||
double p, q;
|
||||
double init_p, p, q;
|
||||
size_t stiffness;
|
||||
double V;
|
||||
void _compute_volume();
|
||||
|
|
Loading…
Reference in a new issue