MayaFlux 0.5.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 389 of file PhysicsOperator.cpp.

392{
393 size_t global_index = 0;
394
395 for (auto& group : m_collections) {
396 for (auto& i : group.physics_state) {
397 auto val = source->get_node_output(global_index++);
398 if (!val)
399 continue;
400
401 auto force = static_cast<float>(*val);
402
403 if (param == "force_x") {
404 i.force.x += force;
405 } else if (param == "force_y") {
406 i.force.y += force;
407 } else if (param == "force_z") {
408 i.force.z += force;
409 }
410 }
411 }
412}
std::vector< CollectionGroup > m_collections
Source source()
Begin a Source chain.
Definition Plot.hpp:128

References m_collections.

Referenced by apply_one_to_one().

+ Here is the caller graph for this function: