void InsertPhysicsTransformJob::recursive_step(Qt3D::QNodeId id){ if(id.isNull()) return; PhysicsEntity* entity= static_cast<PhysicsEntity*>(m_manager->m_resources.operator [](id)); if(!entity->physicsBodyInfo().isNull() && !entity->default_transform().isNull() && entity->physics_transform().isNull()){ /*Make the backend node notify the front end that a matrix should be added*/ PhysicsBodyInfoBackendNode* b_info=static_cast<PhysicsBodyInfoBackendNode*>(m_manager->m_resources.operator [](entity->physicsBodyInfo())); b_info->notifyFrontEnd("attachPhysicsTransfrom",QVariantMap()); } for(Qt3D::QNodeId childId : entity->childrenIds()) recursive_step(childId); }
auto recursive_step(Re&& reduction, In&& input, Rdr & reducer, Rest&... rest) { using first_result_type = decltype(reducer.step(reduction, input)); using rest_result_type = decltype(recursive_step(reduction, std::forward<In>(input), rest...)); using result_type = typename std::conditional< is_reduction_wrapper<first_result_type>::value || is_reduction_wrapper<rest_result_type>::value, wrapped_t<first_result_type>, first_result_type>::type; result_type _result = reduction; // do not forward input to step function because it can't // be consumed until the final reducer gets its hands on it _result = reducer.step(_result, input); if (is_reduced(_result)) { return _result; } return recursive_step(std::move(_result), std::forward<In>(input), rest...); }
void InsertPhysicsTransformJob::run(){ recursive_step(m_manager->rootEntityId()); }
auto _step(Re&& reduction, In&& input, helpers::index<Is...>) { return recursive_step(std::forward<Re>(reduction), std::forward<In>(input), std::get<Is>(m_reducers)...); }