mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
maded vec3 constexprable, addded lvl waring option
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user