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

◆ apply_per_particle_force()

void MayaFlux::Nodes::Network::PhysicsOperator::apply_per_particle_force ( std::string_view  param,
const std::shared_ptr< NodeNetwork > &  source 
)
private

Definition at line 420 of file PhysicsOperator.cpp.

423{
424 size_t global_index = 0;
425
426 for (auto& group : m_collections) {
427 for (auto& i : group.physics_state) {
428 auto val = source->get_node_output(global_index++);
429 if (!val)
430 continue;
431
432 auto force = static_cast<float>(*val);
433
434 if (param == "force_x") {
435 i.force.x += force;
436 } else if (param == "force_y") {
437 i.force.y += force;
438 } else if (param == "force_z") {
439 i.force.z += force;
440 }
441 }
442 }
443}
std::vector< CollectionGroup > m_collections
Source source()
Begin a Source chain.
Definition Plot.hpp:127

References m_collections.

Referenced by apply_one_to_one().

+ Here is the caller graph for this function: