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

◆ integrate()

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

Definition at line 671 of file PhysicsOperator.cpp.

672{
673 for (auto& group : m_collections) {
674 auto& points = group.collection->get_points();
675
676 for (size_t i = 0; i < points.size(); ++i) {
677 auto& state = group.physics_state[i];
678 auto& vertex = points[i];
679
680 glm::vec3 acceleration = state.force / state.mass;
681 state.velocity += acceleration * dt;
682 state.velocity *= (1.0F - m_drag);
683 vertex.position += state.velocity * dt;
684
685 state.force = glm::vec3(0.0F);
686 }
687 }
688}
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: