MayaFlux 0.2.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 341 of file PhysicsOperator.cpp.

344{
345 size_t global_index = 0;
346
347 for (auto& group : m_collections) {
348 for (auto& i : group.physics_state) {
349 auto val = source->get_node_output(global_index++);
350 if (!val)
351 continue;
352
353 auto force = static_cast<float>(*val);
354
355 if (param == "force_x") {
356 i.force.x += force;
357 } else if (param == "force_y") {
358 i.force.y += force;
359 } else if (param == "force_z") {
360 i.force.z += force;
361 }
362 }
363 }
364}
std::vector< CollectionGroup > m_collections

References m_collections.

Referenced by apply_one_to_one().

+ Here is the caller graph for this function: