MayaFlux 0.4.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 591 of file PhysicsOperator.cpp.

592{
593 size_t offset = 0;
594 for (auto& group : m_collections) {
595 if (index < offset + group.collection->get_point_count()) {
596 size_t local_index = index - offset;
597 group.physics_state[local_index].velocity += impulse / group.physics_state[local_index].mass;
598 return;
599 }
600 offset += group.collection->get_point_count();
601 }
602}
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: