mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 23:13:26 +00:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 413cef4f23 | |||
| 867cee41c3 | |||
| 990fe78a33 | |||
| 1efdb50f73 | |||
|
|
86fea065e7 | ||
|
|
ac046aae6c | ||
|
|
9646054877 | ||
| 6334002639 | |||
| 72e0c0c90b | |||
| 2f2a5a00c4 | |||
| c394993418 | |||
| 476048583d | |||
| 76ae67c968 |
@@ -1,15 +1,21 @@
|
|||||||
cmake_minimum_required(VERSION 3.26)
|
cmake_minimum_required(VERSION 3.26)
|
||||||
|
|
||||||
project(omath VERSION 3.5.0 LANGUAGES CXX)
|
project(omath VERSION 3.8.2 LANGUAGES CXX)
|
||||||
|
|
||||||
include(CMakePackageConfigHelpers)
|
include(CMakePackageConfigHelpers)
|
||||||
|
include(CheckCXXCompilerFlag)
|
||||||
|
|
||||||
|
if (MSVC)
|
||||||
|
check_cxx_compiler_flag("/arch:AVX2" COMPILER_SUPPORTS_AVX2)
|
||||||
|
else ()
|
||||||
|
check_cxx_compiler_flag("-mavx2" COMPILER_SUPPORTS_AVX2)
|
||||||
|
endif ()
|
||||||
|
|
||||||
option(OMATH_BUILD_TESTS "Build unit tests" ${PROJECT_IS_TOP_LEVEL})
|
option(OMATH_BUILD_TESTS "Build unit tests" ${PROJECT_IS_TOP_LEVEL})
|
||||||
option(OMATH_BUILD_BENCHMARK "Build benchmarks" ${PROJECT_IS_TOP_LEVEL})
|
option(OMATH_BUILD_BENCHMARK "Build benchmarks" ${PROJECT_IS_TOP_LEVEL})
|
||||||
option(OMATH_THREAT_WARNING_AS_ERROR "Set highest level of warnings and force compiler to treat them as errors" ON)
|
option(OMATH_THREAT_WARNING_AS_ERROR "Set highest level of warnings and force compiler to treat them as errors" ON)
|
||||||
option(OMATH_BUILD_AS_SHARED_LIBRARY "Build Omath as .so or .dll" OFF)
|
option(OMATH_BUILD_AS_SHARED_LIBRARY "Build Omath as .so or .dll" OFF)
|
||||||
option(OMATH_USE_AVX2 "Omath will use AVX2 to boost performance" ON)
|
option(OMATH_USE_AVX2 "Omath will use AVX2 to boost performance" ${COMPILER_SUPPORTS_AVX2})
|
||||||
option(OMATH_IMGUI_INTEGRATION "Omath will define method to convert omath types to imgui types" OFF)
|
option(OMATH_IMGUI_INTEGRATION "Omath will define method to convert omath types to imgui types" OFF)
|
||||||
option(OMATH_BUILD_EXAMPLES "Build example projects with you can learn & play" OFF)
|
option(OMATH_BUILD_EXAMPLES "Build example projects with you can learn & play" OFF)
|
||||||
option(OMATH_STATIC_MSVC_RUNTIME_LIBRARY "Force Omath to link static runtime" OFF)
|
option(OMATH_STATIC_MSVC_RUNTIME_LIBRARY "Force Omath to link static runtime" OFF)
|
||||||
@@ -17,6 +23,11 @@ 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" OFF)
|
option(OMATH_USE_UNITY_BUILD "Will enable unity build to speed up compilation" OFF)
|
||||||
option(OMATH_ENABLE_LEGACY "Will enable legacy classes that MUST be used ONLY for backward compatibility" OFF)
|
option(OMATH_ENABLE_LEGACY "Will enable legacy classes that MUST be used ONLY for backward compatibility" OFF)
|
||||||
|
|
||||||
|
if (OMATH_USE_AVX2 AND NOT COMPILER_SUPPORTS_AVX2)
|
||||||
|
message(WARNING "OMATH_USE_AVX2 requested, but compiler/target does not support AVX2. Disabling.")
|
||||||
|
set(OMATH_USE_AVX2 OFF CACHE BOOL "Omath will use AVX2 to boost performance" FORCE)
|
||||||
|
endif ()
|
||||||
|
|
||||||
message(STATUS "[${PROJECT_NAME}]: Building on ${CMAKE_HOST_SYSTEM_NAME}, compiler ${CMAKE_CXX_COMPILER_ID}")
|
message(STATUS "[${PROJECT_NAME}]: Building on ${CMAKE_HOST_SYSTEM_NAME}, compiler ${CMAKE_CXX_COMPILER_ID}")
|
||||||
message(STATUS "[${PROJECT_NAME}]: Warnings as errors ${OMATH_THREAT_WARNING_AS_ERROR}")
|
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}]: Build unit tests ${OMATH_BUILD_TESTS}")
|
||||||
@@ -93,8 +104,14 @@ if (OMATH_STATIC_MSVC_RUNTIME_LIBRARY)
|
|||||||
)
|
)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (OMATH_USE_AVX2 AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
if (OMATH_USE_AVX2)
|
||||||
target_compile_options(${PROJECT_NAME} PUBLIC -mavx2 -mavx -mfma)
|
if (MSVC)
|
||||||
|
target_compile_options(${PROJECT_NAME} PUBLIC /arch:AVX2)
|
||||||
|
elseif (EMSCRIPTEN)
|
||||||
|
target_compile_options(${PROJECT_NAME} PUBLIC -msimd128 -mavx2)
|
||||||
|
elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
|
||||||
|
target_compile_options(${PROJECT_NAME} PUBLIC -mfma -mavx2)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_23)
|
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_23)
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
"binaryDir": "${sourceDir}/cmake-build/build/${presetName}",
|
"binaryDir": "${sourceDir}/cmake-build/build/${presetName}",
|
||||||
"installDir": "${sourceDir}/cmake-build/install/${presetName}",
|
"installDir": "${sourceDir}/cmake-build/install/${presetName}",
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_C_COMPILER": "cl.exe",
|
|
||||||
"CMAKE_CXX_COMPILER": "cl.exe"
|
"CMAKE_CXX_COMPILER": "cl.exe"
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
@@ -40,7 +39,6 @@
|
|||||||
"binaryDir": "${sourceDir}/cmake-build/build/${presetName}",
|
"binaryDir": "${sourceDir}/cmake-build/build/${presetName}",
|
||||||
"installDir": "${sourceDir}/cmake-build/install/${presetName}",
|
"installDir": "${sourceDir}/cmake-build/install/${presetName}",
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_C_COMPILER": "clang",
|
|
||||||
"CMAKE_CXX_COMPILER": "clang++"
|
"CMAKE_CXX_COMPILER": "clang++"
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
@@ -72,7 +70,6 @@
|
|||||||
"binaryDir": "${sourceDir}/cmake-build/build/${presetName}",
|
"binaryDir": "${sourceDir}/cmake-build/build/${presetName}",
|
||||||
"installDir": "${sourceDir}/cmake-build/install/${presetName}",
|
"installDir": "${sourceDir}/cmake-build/install/${presetName}",
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_C_COMPILER": "clang",
|
|
||||||
"CMAKE_CXX_COMPILER": "clang++"
|
"CMAKE_CXX_COMPILER": "clang++"
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
|
|||||||
50
README.md
50
README.md
@@ -22,6 +22,7 @@ It provides the latest features, is highly customizable, has all for cheat devel
|
|||||||
|
|
||||||
**[<kbd> <br> Install <br> </kbd>][INSTALL]**
|
**[<kbd> <br> Install <br> </kbd>][INSTALL]**
|
||||||
**[<kbd> <br> Examples <br> </kbd>][EXAMPLES]**
|
**[<kbd> <br> Examples <br> </kbd>][EXAMPLES]**
|
||||||
|
**[<kbd> <br> Documentation <br> </kbd>][DOCUMENTATION]**
|
||||||
**[<kbd> <br> Contribute <br> </kbd>][CONTRIBUTING]**
|
**[<kbd> <br> Contribute <br> </kbd>][CONTRIBUTING]**
|
||||||
**[<kbd> <br> Donate <br> </kbd>][SPONSOR]**
|
**[<kbd> <br> Donate <br> </kbd>][SPONSOR]**
|
||||||
|
|
||||||
@@ -42,7 +43,7 @@ It provides the latest features, is highly customizable, has all for cheat devel
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
## 👁🗨 Features
|
# Features
|
||||||
- **Efficiency**: Optimized for performance, ensuring quick computations using AVX2.
|
- **Efficiency**: Optimized for performance, ensuring quick computations using AVX2.
|
||||||
- **Versatility**: Includes a wide array of mathematical functions and algorithms.
|
- **Versatility**: Includes a wide array of mathematical functions and algorithms.
|
||||||
- **Ease of Use**: Simplified interface for convenient integration into various projects.
|
- **Ease of Use**: Simplified interface for convenient integration into various projects.
|
||||||
@@ -51,6 +52,9 @@ It provides the latest features, is highly customizable, has all for cheat devel
|
|||||||
- **Collision Detection**: Production ready code to handle collision detection by using simple interfaces.
|
- **Collision Detection**: Production ready code to handle collision detection by using simple interfaces.
|
||||||
- **No Additional Dependencies**: No additional dependencies need to use OMath except unit test execution
|
- **No Additional Dependencies**: No additional dependencies need to use OMath except unit test execution
|
||||||
- **Ready for meta-programming**: Omath use templates for common types like Vectors, Matrixes etc, to handle all types!
|
- **Ready for meta-programming**: Omath use templates for common types like Vectors, Matrixes etc, to handle all types!
|
||||||
|
- **Engine support**: Supports coordinate systems of Source, Unity, Unreal, IWEngine and canonical OpenGL.
|
||||||
|
- **Cross platform**: Supports Windows, MacOS and Linux.
|
||||||
|
<div align = center>
|
||||||
|
|
||||||
# Gallery
|
# Gallery
|
||||||
|
|
||||||
@@ -73,48 +77,9 @@ It provides the latest features, is highly customizable, has all for cheat devel
|
|||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
# 💘 Acknowledgments
|
||||||
## Supported Render Pipelines
|
|
||||||
| ENGINE | SUPPORT |
|
|
||||||
|----------|---------|
|
|
||||||
| Source | ✅YES |
|
|
||||||
| Unity | ✅YES |
|
|
||||||
| IWEngine | ✅YES |
|
|
||||||
| OpenGL | ✅YES |
|
|
||||||
| Unreal | ✅YES |
|
|
||||||
|
|
||||||
## Supported Operating Systems
|
|
||||||
|
|
||||||
| OS | SUPPORT |
|
|
||||||
|----------------|---------|
|
|
||||||
| Windows 10/11 | ✅YES |
|
|
||||||
| Linux | ✅YES |
|
|
||||||
| Darwin (MacOS) | ✅YES |
|
|
||||||
|
|
||||||
## ❔ Usage
|
|
||||||
ESP example
|
|
||||||
```c++
|
|
||||||
omath::source_engine::Camera cam{localPlayer.GetCameraOrigin(),
|
|
||||||
localPlayer.GetAimPunch(),
|
|
||||||
{1920.f, 1080.f},
|
|
||||||
localPlayer.GetFieldOfView(),
|
|
||||||
0.01.f, 30000.f};
|
|
||||||
|
|
||||||
for (auto ent: apex_sdk::EntityList::GetAllEntities())
|
|
||||||
{
|
|
||||||
const auto bottom = cam.world_to_screen(ent.GetOrigin());
|
|
||||||
const auto top = cam.world_to_screen(ent.GetBonePosition(8) + omath::Vector3<float>{0, 0, 10});
|
|
||||||
|
|
||||||
const auto ent_health = ent.GetHealth();
|
|
||||||
|
|
||||||
if (!top || !bottom || ent_health <= 0)
|
|
||||||
continue;
|
|
||||||
// esp rendering...
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## 💘 Acknowledgments
|
|
||||||
- [All contributors](https://github.com/orange-cpp/omath/graphs/contributors)
|
- [All contributors](https://github.com/orange-cpp/omath/graphs/contributors)
|
||||||
|
|
||||||
<!----------------------------------{ Images }--------------------------------->
|
<!----------------------------------{ Images }--------------------------------->
|
||||||
@@ -124,6 +89,7 @@ for (auto ent: apex_sdk::EntityList::GetAllEntities())
|
|||||||
|
|
||||||
<!----------------------------------{ Buttons }--------------------------------->
|
<!----------------------------------{ Buttons }--------------------------------->
|
||||||
[INSTALL]: INSTALL.md
|
[INSTALL]: INSTALL.md
|
||||||
|
[DOCUMENTATION]: http://libomath.org
|
||||||
[CONTRIBUTING]: CONTRIBUTING.md
|
[CONTRIBUTING]: CONTRIBUTING.md
|
||||||
[EXAMPLES]: examples
|
[EXAMPLES]: examples
|
||||||
[SPONSOR]: https://boosty.to/orangecpp/purchase/3568644?ssource=DIRECT&share=subscription_link
|
[SPONSOR]: https://boosty.to/orangecpp/purchase/3568644?ssource=DIRECT&share=subscription_link
|
||||||
|
|||||||
Reference in New Issue
Block a user