added more classes

This commit is contained in:
2025-02-23 09:57:29 +03:00
parent d9684ff73f
commit 28a35d5bc9
13 changed files with 213 additions and 26 deletions

View File

@@ -1,15 +1,17 @@
#include <gtest/gtest.h>
#include <omath/prediction/Engine.hpp>
#include <omath/projectile_prediction/Engine.hpp>
TEST(UnitTestPrediction, PredictionTest)
{
constexpr omath::prediction::Target target{
constexpr omath::projectile_prediction::Target target{
.m_origin = {100, 0, 90}, .m_velocity = {0, 0, 0}, .m_isAirborne = false};
constexpr omath::prediction::Projectile proj = {.m_origin = {3,2,1}, .m_launchSpeed = 5000, .m_gravityScale= 0.4};
const auto viewPoint = omath::prediction::Engine(400, 1.f / 1000.f, 50, 5.f).MaybeCalculateAimPoint(proj, target);
constexpr omath::projectile_prediction::Projectile proj = {
.m_origin = {3, 2, 1}, .m_launchSpeed = 5000, .m_gravityScale = 0.4};
const auto viewPoint =
omath::projectile_prediction::Engine(400, 1.f / 1000.f, 50, 5.f).MaybeCalculateAimPoint(proj, target);
const auto [pitch, yaw, _] = proj.m_origin.ViewAngleTo(viewPoint.value()).AsTuple();
EXPECT_NEAR(42.547142, pitch, 0.01f);
EXPECT_NEAR(-1.181189, yaw, 0.01f);
}
}