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

◆ apply_impulse()

void MayaFlux::Nodes::Network::PhysicsOperator::apply_impulse ( size_t  index,
const glm::vec3 &  impulse 
)

Apply impulse to specific particle.

Definition at line 584 of file PhysicsOperator.cpp.

585{
586 size_t offset = 0;
587 for (auto& group : m_collections) {
588 if (index < offset + group.collection->get_point_count()) {
589 size_t local_index = index - offset;
590 group.physics_state[local_index].velocity += impulse / group.physics_state[local_index].mass;
591 return;
592 }
593 offset += group.collection->get_point_count();
594 }
595}
size_t get_point_count() const override
Get source point count (before topology expansion)
std::vector< CollectionGroup > m_collections

References get_point_count(), and m_collections.

+ Here is the call graph for this function: