added more noexcept

This commit is contained in:
2025-05-05 01:46:50 +03:00
parent a6e4c0461d
commit 50ddf2d31e
25 changed files with 79 additions and 79 deletions

View File

@@ -9,8 +9,8 @@ namespace omath::projectile_prediction
class ProjPredEngineAvx2 final : public ProjPredEngine
{
public:
[[nodiscard]] std::optional<Vector3<float>> maybe_calculate_aim_point(const Projectile& projectile,
const Target& target) const override;
[[nodiscard]] std::optional<Vector3<float>>
maybe_calculate_aim_point(const Projectile& projectile, const Target& target) const override;
ProjPredEngineAvx2(float gravity_constant, float simulation_time_step, float maximum_simulation_time);
~ProjPredEngineAvx2() override = default;
@@ -18,7 +18,7 @@ namespace omath::projectile_prediction
private:
[[nodiscard]] static std::optional<float> calculate_pitch(const Vector3<float>& proj_origin,
const Vector3<float>& target_pos,
float bullet_gravity, float v0, float time);
float bullet_gravity, float v0, float time) ;
// We use [[maybe_unused]] here since AVX2 is not available for ARM and ARM64 CPU
[[maybe_unused]] const float m_gravity_constant;

View File

@@ -29,11 +29,12 @@ namespace omath::projectile_prediction
const float m_distance_tolerance;
[[nodiscard]]
std::optional<float> maybe_calculate_projectile_launch_pitch_angle(const Projectile& projectile,
const Vector3<float>& target_position) const;
std::optional<float>
maybe_calculate_projectile_launch_pitch_angle(const Projectile& projectile,
const Vector3<float>& target_position) const noexcept;
[[nodiscard]]
bool is_projectile_reached_target(const Vector3<float>& target_position, const Projectile& projectile,
float pitch, float time) const;
float pitch, float time) const noexcept;
};
} // namespace omath::projectile_prediction

View File

@@ -11,7 +11,7 @@ namespace omath::projectile_prediction
{
public:
[[nodiscard]]
Vector3<float> predict_position(float pitch, float yaw, float time, float gravity) const;
Vector3<float> predict_position(float pitch, float yaw, float time, float gravity) const noexcept;
Vector3<float> m_origin;
float m_launch_speed{};

View File

@@ -11,7 +11,7 @@ namespace omath::projectile_prediction
{
public:
[[nodiscard]]
constexpr Vector3<float> predict_position(const float time, const float gravity) const
constexpr Vector3<float> predict_position(const float time, const float gravity) const noexcept
{
auto predicted = m_origin + m_velocity * time;