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 636 of file PhysicsOperator.cpp.

637{
638 size_t offset = 0;
639 for (auto& group : m_collections) {
640 if (index < offset + group.collection->get_point_count()) {
641 size_t local_index = index - offset;
642 group.physics_state[local_index].velocity += impulse / group.physics_state[local_index].mass;
643 return;
644 }
645 offset += group.collection->get_point_count();
646 }
647}
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: