From 77893629f9a41e9682f6c6764d9132197e8d5d3a Mon Sep 17 00:00:00 2001 From: Orange Date: Mon, 25 Aug 2025 22:33:00 +0300 Subject: [PATCH] Adds omath library header Creates the main omath header file that includes all omath library components. This provides a single point of inclusion for the entire library, simplifying usage and dependency management. Also, adjusts the return types for projectile prediction functions within the legacy engine to explicitly use the `Vector3` type for consistency and clarity. --- include/omath/omath.hpp | 84 +++++++++++++++++++ .../proj_pred_engine_legacy.hpp | 6 +- 2 files changed, 87 insertions(+), 3 deletions(-) create mode 100644 include/omath/omath.hpp diff --git a/include/omath/omath.hpp b/include/omath/omath.hpp new file mode 100644 index 0000000..84e4005 --- /dev/null +++ b/include/omath/omath.hpp @@ -0,0 +1,84 @@ +// +// omath.hpp - Main header file that includes all omath library components +// Created for the omath library +// + +#pragma once + +// Basic math utilities +#include "omath/angles.hpp" +#include "omath/angle.hpp" + +// Vector classes (in dependency order) +#include "omath/vector2.hpp" +#include "omath/vector3.hpp" +#include "omath/vector4.hpp" + +// Matrix classes +#include "omath/mat.hpp" +#include "omath/matrix.hpp" + +// Color functionality +#include "omath/color.hpp" + +// Geometric primitives +#include "omath/triangle.hpp" +#include "omath/view_angles.hpp" + +// 3D primitives +#include "omath/3d_primitives/box.hpp" + +// Collision detection +#include "omath/collision/line_tracer.hpp" + +// Pathfinding algorithms +#include "omath/pathfinding/a_star.hpp" +#include "omath/pathfinding/navigation_mesh.hpp" + +// Projectile prediction +#include "omath/projectile_prediction/projectile.hpp" +#include "omath/projectile_prediction/target.hpp" +#include "omath/projectile_prediction/proj_pred_engine.hpp" +#include "omath/projectile_prediction/proj_pred_engine_legacy.hpp" +#include "omath/projectile_prediction/proj_pred_engine_avx2.hpp" + +// Projection functionality +#include "omath/projection/error_codes.hpp" +#include "omath/projection/camera.hpp" + +// Engine-specific implementations + +// IW Engine +#include "omath/engines/iw_engine/constants.hpp" +#include "omath/engines/iw_engine/formulas.hpp" +#include "omath/engines/iw_engine/camera.hpp" +#include "omath/engines/iw_engine/traits/camera_trait.hpp" +#include "omath/engines/iw_engine/traits/pred_engine_trait.hpp" + +// OpenGL Engine +#include "omath/engines/opengl_engine/constants.hpp" +#include "omath/engines/opengl_engine/formulas.hpp" +#include "omath/engines/opengl_engine/camera.hpp" +#include "omath/engines/opengl_engine/traits/camera_trait.hpp" +#include "omath/engines/opengl_engine/traits/pred_engine_trait.hpp" + +// Source Engine +#include "omath/engines/source_engine/constants.hpp" +#include "omath/engines/source_engine/formulas.hpp" +#include "omath/engines/source_engine/camera.hpp" +#include "omath/engines/source_engine/traits/camera_trait.hpp" +#include "omath/engines/source_engine/traits/pred_engine_trait.hpp" + +// Unity Engine +#include "omath/engines/unity_engine/constants.hpp" +#include "omath/engines/unity_engine/formulas.hpp" +#include "omath/engines/unity_engine/camera.hpp" +#include "omath/engines/unity_engine/traits/camera_trait.hpp" +#include "omath/engines/unity_engine/traits/pred_engine_trait.hpp" + +// Unreal Engine +#include "omath/engines/unreal_engine/constants.hpp" +#include "omath/engines/unreal_engine/formulas.hpp" +#include "omath/engines/unreal_engine/camera.hpp" +#include "omath/engines/unreal_engine/traits/camera_trait.hpp" +#include "omath/engines/unreal_engine/traits/pred_engine_trait.hpp" \ No newline at end of file diff --git a/include/omath/projectile_prediction/proj_pred_engine_legacy.hpp b/include/omath/projectile_prediction/proj_pred_engine_legacy.hpp index f253c8e..fed6306 100644 --- a/include/omath/projectile_prediction/proj_pred_engine_legacy.hpp +++ b/include/omath/projectile_prediction/proj_pred_engine_legacy.hpp @@ -20,11 +20,11 @@ namespace omath::projectile_prediction Vector3 v3, // by-value for calc_viewpoint_from_angles float pitch, float yaw, float time, float gravity, std::optional maybe_pitch) { // Presence + return types - { T::predict_projectile_position(projectile, pitch, yaw, time, gravity) } -> std::same_as; - { T::predict_target_position(target, time, gravity) } -> std::same_as; + { T::predict_projectile_position(projectile, pitch, yaw, time, gravity) } -> std::same_as>; + { T::predict_target_position(target, time, gravity) } -> std::same_as>; { T::calc_vector_2d_distance(vec_a) } -> std::same_as; { T::get_vector_height_coordinate(vec_b) } -> std::same_as; - { T::calc_viewpoint_from_angles(projectile, v3, maybe_pitch) } -> std::same_as; + { T::calc_viewpoint_from_angles(projectile, v3, maybe_pitch) } -> std::same_as>; { T::calc_direct_pitch_angle(vec_a, vec_b) } -> std::same_as; { T::calc_direct_yaw_angle(vec_a, vec_b) } -> std::same_as;