25 #ifndef INCLUDED_ForEachTracked_h_GUID_8DA1845D_2D7F_4C8C_9424_C18D06339380
26 #define INCLUDED_ForEachTracked_h_GUID_8DA1845D_2D7F_4C8C_9424_C18D06339380
42 template <
typename F>
inline void forEachBody(TrackingSystem &sys, F &&f) {
43 auto n =
static_cast<BodyId::wrapped_type
>(sys.getNumBodies());
44 for (BodyId::wrapped_type i = 0; i < n; ++i) {
45 f(sys.getBody(BodyId(i)));
51 inline void forEachBody(TrackingSystem
const &sys, F &&f) {
52 auto n =
static_cast<BodyId::wrapped_type
>(sys.getNumBodies());
53 for (BodyId::wrapped_type i = 0; i < n; ++i) {
54 f(sys.getBody(BodyId(i)));
61 template <
typename F>
inline void forEachTarget(TrackedBody &body, F &&f) {
62 body.forEachTarget(std::forward<F>(f));
69 inline void forEachTarget(TrackedBody
const &body, F &&f) {
70 body.forEachTarget(std::forward<F>(f));
75 inline void forEachTarget(TrackingSystem &sys, F &&f) {
76 forEachBody(sys, [&](TrackedBody &body) {
77 forEachTarget(body, std::forward<F>(f));
83 inline void forEachTarget(TrackingSystem
const &sys, F &&f) {
84 forEachBody(sys, [&](TrackedBody
const &body) {
85 forEachTarget(body, std::forward<F>(f));
90 template <
typename F>
inline void forEachIMU(TrackingSystem &sys, F &&f) {
91 forEachBody(sys, [&](TrackedBody &body) {
100 inline void forEachIMU(TrackingSystem
const &sys, F &&f) {
101 forEachBody(sys, [&](TrackedBody
const &body) {
109 #endif // INCLUDED_ForEachTracked_h_GUID_8DA1845D_2D7F_4C8C_9424_C18D06339380