mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-14 15:33:26 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 77893629f9 | |||
| afb27b1aa9 | |||
| 61006122ae | |||
| 4eb0f59fc0 | |||
| 3b4bf24a16 | |||
| 51d93c4464 |
@@ -1,6 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.26)
|
||||
|
||||
project(omath VERSION 3.2.1 LANGUAGES CXX)
|
||||
project(omath VERSION 3.3.0 LANGUAGES CXX)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
@@ -16,6 +16,16 @@ option(OMATH_SUPRESS_SAFETY_CHECKS "Supress some safety checks in release build
|
||||
option(OMATH_USE_UNITY_BUILD "Will enable unity build to speed up compilation" ON)
|
||||
option(OMATH_ENABLE_LEGACY "Will enable legacy classes that MUST be used ONLY for backward compatibility" OFF)
|
||||
|
||||
message(STATUS "[${PROJECT_NAME}]: Building on ${CMAKE_HOST_SYSTEM_NAME}")
|
||||
message(STATUS "[${PROJECT_NAME}]: Warnings as errors ${OMATH_THREAT_WARNING_AS_ERROR}")
|
||||
message(STATUS "[${PROJECT_NAME}]: Build unit tests ${OMATH_BUILD_TESTS}")
|
||||
message(STATUS "[${PROJECT_NAME}]: As dynamic library ${OMATH_BUILD_AS_SHARED_LIBRARY}")
|
||||
message(STATUS "[${PROJECT_NAME}]: Static C++ runtime ${OMATH_STATIC_MSVC_RUNTIME_LIBRARY}")
|
||||
message(STATUS "[${PROJECT_NAME}]: CMake unity build ${OMATH_USE_UNITY_BUILD}")
|
||||
message(STATUS "[${PROJECT_NAME}]: Example projects ${OMATH_BUILD_EXAMPLES}")
|
||||
message(STATUS "[${PROJECT_NAME}]: AVX2 feature status ${OMATH_USE_AVX2}")
|
||||
message(STATUS "[${PROJECT_NAME}]: ImGUI integration feature status ${OMATH_IMGUI_INTEGRATION}")
|
||||
message(STATUS "[${PROJECT_NAME}]: Legacy features support ${OMATH_ENABLE_LEGACY}")
|
||||
|
||||
file(GLOB_RECURSE OMATH_SOURCES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp")
|
||||
file(GLOB_RECURSE OMATH_HEADERS CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp")
|
||||
@@ -27,8 +37,6 @@ else ()
|
||||
add_library(${PROJECT_NAME} STATIC ${OMATH_SOURCES} ${OMATH_HEADERS})
|
||||
endif ()
|
||||
|
||||
message(STATUS "[OMATH]: Building on ${CMAKE_HOST_SYSTEM_NAME}")
|
||||
|
||||
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
|
||||
|
||||
if (OMATH_IMGUI_INTEGRATION)
|
||||
|
||||
84
include/omath/omath.hpp
Normal file
84
include/omath/omath.hpp
Normal file
@@ -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"
|
||||
@@ -20,11 +20,11 @@ namespace omath::projectile_prediction
|
||||
Vector3<float> v3, // by-value for calc_viewpoint_from_angles
|
||||
float pitch, float yaw, float time, float gravity, std::optional<float> maybe_pitch) {
|
||||
// Presence + return types
|
||||
{ T::predict_projectile_position(projectile, pitch, yaw, time, gravity) } -> std::same_as<Vec3>;
|
||||
{ T::predict_target_position(target, time, gravity) } -> std::same_as<Vec3>;
|
||||
{ T::predict_projectile_position(projectile, pitch, yaw, time, gravity) } -> std::same_as<Vector3<float>>;
|
||||
{ T::predict_target_position(target, time, gravity) } -> std::same_as<Vector3<float>>;
|
||||
{ T::calc_vector_2d_distance(vec_a) } -> std::same_as<float>;
|
||||
{ T::get_vector_height_coordinate(vec_b) } -> std::same_as<float>;
|
||||
{ T::calc_viewpoint_from_angles(projectile, v3, maybe_pitch) } -> std::same_as<Vec3>;
|
||||
{ T::calc_viewpoint_from_angles(projectile, v3, maybe_pitch) } -> std::same_as<Vector3<float>>;
|
||||
{ T::calc_direct_pitch_angle(vec_a, vec_b) } -> std::same_as<float>;
|
||||
{ T::calc_direct_yaw_angle(vec_a, vec_b) } -> std::same_as<float>;
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
//
|
||||
// Created by Vlad on 8/25/2025.
|
||||
//
|
||||
//
|
||||
// Created by Orange on 11/27/2024.
|
||||
//
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
Reference in New Issue
Block a user