refactored camera

This commit is contained in:
2024-12-04 04:58:29 +03:00
parent 9c0285e353
commit 0afa20b4e5
16 changed files with 262 additions and 194 deletions

View File

@@ -4,13 +4,13 @@
#include "omath/prediction/Projectile.hpp"
#include <cmath>
#include <omath/engines/Source.hpp>
#include <omath/engines/Source/Formulas.hpp>
namespace omath::prediction
{
Vector3 Projectile::PredictPosition(const float pitch, const float yaw, const float time, const float gravity) const
{
auto currentPos = m_origin + omath::source::ForwardVector({source::PitchAngle::FromDegrees(pitch), source::YawAngle::FromDegrees(yaw), source::RollAngle::FromDegrees(0)}) * m_launchSpeed * time;
auto currentPos = m_origin + omath::source::ForwardVector({source::PitchAngle::FromDegrees(-pitch), source::YawAngle::FromDegrees(yaw), source::RollAngle::FromDegrees(0)}) * m_launchSpeed * time;
currentPos.z -= (gravity * m_gravityScale) * std::pow(time, 2.f) * 0.5f;
return currentPos;