#include "fiko/cam/takim_yolu.hpp" #include namespace fiko::cam { void TakimYolu::istatistikGuncelle() { kesmeUzunluk = 0; hizliUzunluk = 0; sureDk = 0; constexpr f64 HIZLI_MMDK = 5000.0; for (size_t i = 1; i < hamleler.size(); ++i) { const Vec3d f = hamleler[i].nokta - hamleler[i - 1].nokta; const f64 u = std::sqrt(f.x * f.x + f.y * f.y + f.z * f.z); if (hamleler[i].tip == HamleTip::Hizli) { hizliUzunluk += u; sureDk += u / HIZLI_MMDK; } else { kesmeUzunluk += u; const f64 il = hamleler[i].ilerleme > 1.0 ? hamleler[i].ilerleme : 1000.0; sureDk += u / il; } } } Aabbf TakimYolu::sinir() const { Aabbf s; for (const Hamle& h : hamleler) s.genislet({(f32)h.nokta.x, (f32)h.nokta.y, (f32)h.nokta.z}); for (const Vec3d& d : delikler) s.genislet({(f32)d.x, (f32)d.y, (f32)d.z}); return s; } } // namespace fiko::cam