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

◆ resolve_global_index()

std::optional< PhysicsOperator::GroupIndex > MayaFlux::Nodes::Network::PhysicsOperator::resolve_global_index ( size_t  global_index) const
private

Resolve a global index the same way apply_impulse/get_data_at do.

Definition at line 526 of file PhysicsOperator.cpp.

527{
528 size_t offset = 0;
529 for (size_t g = 0; g < m_collections.size(); ++g) {
530 size_t count = m_collections[g].collection->get_point_count();
531 if (global_index < offset + count) {
532 return GroupIndex { .group = g, .local = global_index - offset };
533 }
534 offset += count;
535 }
536 return std::nullopt;
537}
size_t count
float offset
std::vector< CollectionGroup > m_collections

References count, MayaFlux::Nodes::Network::PhysicsOperator::GroupIndex::group, m_collections, and offset.

Referenced by apply_bond_forces().

+ Here is the caller graph for this function: