refactored projectile prediction

This commit is contained in:
2024-06-09 21:14:33 +03:00
parent c600d53b20
commit 07360f4e91
16 changed files with 222 additions and 197 deletions

View File

@@ -1,13 +1,13 @@
#include <gtest/gtest.h>
#include <uml/ProjectilePredictor.h>
#include <uml/prediction/Engine.h>
TEST(x,x)
{
uml::prediction::Target target{.m_origin = {100, 0, 60}, .m_vecVelocity = {0,0, 0}, .m_IsAirborne = false};
uml::prediction::Projectile proj = {.m_origin = {3,2,1}, .m_velocity = 400, .m_gravityMultiplier= 0.4};
auto vel = uml::prediction::ProjectilePredictor(400).PredictPointToAim(target, proj);
uml::prediction::Target target{.m_origin = {100, 0, 60}, .m_velocity = {0, 0, 0}, .m_isAirborne = false};
uml::prediction::Projectile proj = {.m_origin = {3,2,1}, .m_launchSpeed = 400, .m_gravityScale= 0.4};
auto vel = uml::prediction::Engine(400, 1.f / 10000.f, 50).MaybeCalculateAimPoint(proj, target);
auto pitch = proj.m_origin.ViewAngleTo(vel.value()).x;
// printf("pitch: %f", pitch);
printf("pitch: %f", pitch);
}