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

391{
392 size_t global_index = 0;
393
394 for (auto& group : m_collections) {
395 for (auto& i : group.physics_state) {
396 auto val = source->get_node_output(global_index++);
397 if (!val)
398 continue;
399
400 auto force = static_cast<float>(*val);
401
402 if (param == "force_x") {
403 i.force.x += force;
404 } else if (param == "force_y") {
405 i.force.y += force;
406 } else if (param == "force_z") {
407 i.force.z += force;
408 }
409 }
410 }
411}
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: