MayaFlux 1.0.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 557 of file PhysicsOperator.cpp.

558{
559 size_t offset = 0;
560 for (size_t g = 0; g < m_collections.size(); ++g) {
561 size_t count = m_collections[g].collection->get_point_count();
562 if (global_index < offset + count) {
563 return GroupIndex { .group = g, .local = global_index - offset };
564 }
565 offset += count;
566 }
567 return std::nullopt;
568}
uint64_t offset
Definition Composite.cpp:10
size_t count
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: