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

◆ integrate()

void MayaFlux::Nodes::Network::PhysicsOperator::integrate ( float  dt)
private

Definition at line 702 of file PhysicsOperator.cpp.

703{
704 for (auto& group : m_collections) {
705 auto& points = group.collection->get_points();
706
707 for (size_t i = 0; i < points.size(); ++i) {
708 auto& state = group.physics_state[i];
709 auto& vertex = points[i];
710
711 glm::vec3 acceleration = state.force / state.mass;
712 state.velocity += acceleration * dt;
713 state.velocity *= (1.0F - m_drag);
714 vertex.position += state.velocity * dt;
715
716 state.force = glm::vec3(0.0F);
717 }
718 }
719}
std::vector< glm::vec2 > * points
std::vector< CollectionGroup > m_collections
T acceleration(const Memory::HistoryBuffer< T > &history, double dt) noexcept
Second difference: rate of change of velocity.

References m_collections, m_drag, and points.

Referenced by process().

+ Here is the caller graph for this function: