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

◆ integrate()

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

Definition at line 534 of file PhysicsOperator.cpp.

535{
536 for (auto& group : m_collections) {
537 auto& points = group.collection->get_points();
538
539 for (size_t i = 0; i < points.size(); ++i) {
540 auto& state = group.physics_state[i];
541 auto& vertex = points[i];
542
543 glm::vec3 acceleration = state.force / state.mass;
544 state.velocity += acceleration * dt;
545 state.velocity *= (1.0F - m_drag);
546 vertex.position += state.velocity * dt;
547
548 state.force = glm::vec3(0.0F);
549 }
550 }
551}
std::vector< glm::vec2 > * points
std::vector< CollectionGroup > m_collections

References m_collections, m_drag, and points.

Referenced by process().

+ Here is the caller graph for this function: