maded vec3 constexprable, addded lvl waring option

This commit is contained in:
2024-09-03 01:54:23 +03:00
parent c0d505b5e2
commit 9e32b043d0
6 changed files with 198 additions and 231 deletions

View File

@@ -8,14 +8,9 @@
namespace omath::prediction
{
Vector3 Projectile::CalculateVelocity(const float pitch, const float yaw) const
{
return Vector3::CreateVelocity(pitch, yaw, m_launchSpeed);
}
Vector3 Projectile::PredictPosition(const float pitch, const float yaw, const float time, const float gravity) const
{
auto currentPos = m_origin + Vector3::CreateVelocity(pitch, yaw, m_launchSpeed) * time;
auto currentPos = m_origin + Vector3::ForwardVector(pitch, yaw) * m_launchSpeed * time;
currentPos.z -= (gravity * m_gravityScale) * std::pow(time, 2.f) * 0.5f;
return currentPos;