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

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

References m_collections.

Referenced by apply_one_to_one().

+ Here is the caller graph for this function: