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

@@ -0,0 +1,20 @@
//
// Created by Vlad on 6/9/2024.
//
#include "uml/prediction/Target.h"
#include <cmath>
namespace uml::prediction
{
Vector3 Target::PredictPosition(const float time, const float gravity) const
{
auto predicted = m_origin + m_velocity * time;
if (m_isAirborne)
predicted.z -= gravity * std::pow(time, 2.f) * 0.5f;
return predicted;
}
}