34 Integrator::updatePosition(*
this, dt);
40 Cell *closestCell =
nullptr;
41 double closestDist =
radius;
43 auto normal =
cell == con->cells.first ? -con->direction : con->direction;
44 double dot = normal.dot(d);
46 const auto &midpoint =
47 cell == con->cells.first ? con->midpoint.first : con->midpoint.second;
48 double l = -midpoint / dot;
49 if (l < closestDist) {
51 closestCell = con->cells.first ==
cell ? con->cells.second : con->cells.first;
55 return std::make_tuple(closestCell, closestDist);
void setPosition(const Vec &p)
void moveTo(Vector3D newpos)
EXPORTABLE(SpringBody, KV(radius), KV(position))
void setStiffness(double k)
Cell * getConnectedCell(const Vec &d) const
SpringBody(Cell *c, Vector3D pos=Vector3D::zero())
double getStiffness() const
void updatePositionsAndOrientations(double dt)
double getPreciseMembraneDistance(const Vec &d) const
double getMomentOfInertia() const
std::vector< SpringConnection< Cell > * > cellConnections
double getBoundingBoxRadius() const
void updateInternals(double)
std::tuple< Cell *, double > getConnectedCellAndMembraneDistance(const Vec &d) const
general purpose 3D vector/point class.
static Vector3D zero()
constructs a zero vector
Represents a cell in the simulation.
A simple vector class template.
this file contains various miscellanious utility functions & helpers *
static constexpr double DEFAULT_CELL_RADIUS
static constexpr double DEFAULT_CELL_STIFFNESS
A Spring Connection is a connection between two cells that aims to models both attractive (for adhesi...