Pull each bonded particle toward its root with a spring.
Rest length scales with cbrt(root's accreted mass): a grown body's satellites settle at a wider spread than a fresh one's, the same way any fixed-density accumulation of matter occupies more volume as it gains mass. Growth is a wider swarm of small particles, not a bigger point.
Definition at line 547 of file PhysicsOperator.cpp.
548{
551 if (root == i) {
552 continue;
553 }
554
557 if (!self_idx || !root_idx) {
558 continue;
559 }
560
561 auto& self_state =
m_collections[self_idx->group].physics_state[self_idx->local];
562 const auto& self_pos =
m_collections[self_idx->group].collection->get_points()[self_idx->local].position;
563 const auto& root_pos =
m_collections[root_idx->group].collection->get_points()[root_idx->local].position;
564
565 glm::vec3 delta = root_pos - self_pos;
566 float distance = glm::length(delta);
567 if (distance < 0.001F) {
568 continue;
569 }
570
572
573 glm::vec3 direction = delta /
distance;
575 }
576}
std::optional< GroupIndex > resolve_global_index(size_t global_index) const
Resolve a global index the same way apply_impulse/get_data_at do.
std::vector< CollectionGroup > m_collections
float get_accreted_mass(size_t global_index) const
This particle's currently accreted mass.
std::vector< uint32_t > m_bond_root
Empty when no bonds are adopted; see sync_bonds_from_claims.
SpatialField distance(const glm::vec3 &anchor, float radius, DistanceMetric metric=DistanceMetric::EUCLIDEAN)
Normalized distance from an anchor point using the specified metric.
References get_accreted_mass(), m_bond_rest_length, m_bond_root, m_bond_stiffness, m_collections, and resolve_global_index().
Referenced by apply_forces().