mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
changed code style
This commit is contained in:
@@ -3,19 +3,20 @@
|
||||
//
|
||||
|
||||
#include "omath/projectile_prediction/projectile.hpp"
|
||||
|
||||
#include <omath/engines/source_engine/formulas.hpp>
|
||||
|
||||
namespace omath::projectile_prediction
|
||||
{
|
||||
Vector3<float> Projectile::PredictPosition(const float pitch, const float yaw, const float time, const float gravity) const
|
||||
Vector3<float> Projectile::predict_position(const float pitch, const float yaw, const float time,
|
||||
const float gravity) const
|
||||
{
|
||||
auto currentPos = m_origin + source_engine::ForwardVector({source_engine::PitchAngle::FromDegrees(-pitch),
|
||||
source_engine::YawAngle::FromDegrees(yaw),
|
||||
source_engine::RollAngle::FromDegrees(0)}) *
|
||||
m_launchSpeed * time;
|
||||
currentPos.z -= (gravity * m_gravityScale) * (time * time) * 0.5f;
|
||||
auto current_pos = m_origin
|
||||
+ source_engine::forward_vector({source_engine::PitchAngle::from_degrees(-pitch),
|
||||
source_engine::YawAngle::from_degrees(yaw),
|
||||
source_engine::RollAngle::from_degrees(0)})
|
||||
* m_launch_speed * time;
|
||||
current_pos.z -= (gravity * m_gravity_scale) * (time * time) * 0.5f;
|
||||
|
||||
return currentPos;
|
||||
return current_pos;
|
||||
}
|
||||
} // namespace omath::prediction
|
||||
} // namespace omath::projectile_prediction
|
||||
|
||||
Reference in New Issue
Block a user