MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ apply_forces()

void MayaFlux::Nodes::Network::PhysicsOperator::apply_forces ( )
private

Definition at line 434 of file PhysicsOperator.cpp.

435{
436 for (auto& group : m_collections) {
437 for (auto& state : group.physics_state) {
438 state.force = m_gravity * state.mass;
439 }
440 }
441
444 }
445
446 if (m_turbulence_strength > 0.001F) {
448 }
449
452 }
453
454 if (!m_bond_root.empty()) {
456 }
457
458 if (!m_force_fields.empty()) {
459 for (auto& group : m_collections) {
460 auto& points = group.collection->get_points();
461
462 for (size_t i = 0; i < points.size(); ++i) {
463 for (const auto& field : m_force_fields) {
464 group.physics_state[i].force += field(points[i].position);
465 }
466 }
467 }
468 }
469}
std::vector< glm::vec2 > * points
std::vector< CollectionGroup > m_collections
std::vector< Kinesis::VectorField > m_force_fields
std::vector< uint32_t > m_bond_root
Empty when no bonds are adopted; see sync_bonds_from_claims.
void apply_bond_forces()
Pull each bonded particle toward its root with a spring.

References apply_attraction_forces(), apply_bond_forces(), apply_spatial_interactions(), apply_turbulence(), m_bond_root, m_collections, m_force_fields, m_gravity, m_has_attraction_point, m_interaction_radius, m_spatial_interactions_enabled, m_turbulence_strength, and points.

Referenced by process().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: