Compare commits

..

14 Commits

Author SHA1 Message Date
1b5a7ed4fd Merge pull request #69 from luadebug/patch-1
Repair omath.hpp by removing unexisting header include
2025-09-15 15:01:04 +03:00
Saikari
362b818a71 Update omath.hpp 2025-09-15 13:13:55 +03:00
29a96d64bb Adds 2D screen to world conversion
Adds an overload for screen_to_world that accepts a 2D screen position.

Renames screen_to_dnc to screen_to_ndc for clarity.
2025-09-14 04:48:56 +03:00
256365e52e patch 2025-09-14 04:43:25 +03:00
e333d81b81 Enables formatting support for Angle objects
Adds a partial specialization of `std::formatter` for `omath::Angle`
to provide formatting support using `std::format`.

This allows `Angle` objects to be easily formatted as strings,
including degree symbol representation, using standard formatting
techniques.
2025-09-14 04:43:01 +03:00
d66f60d419 Removes unnecessary div tag
Removes an empty div tag, which streamlines the HTML structure and contributes to cleaner code.
2025-09-13 20:13:35 +03:00
4a4939b604 Repositions YouTube preview link
Moves the YouTube preview link to improve the README's visual flow.
2025-09-13 20:08:48 +03:00
ebe8d1a90e Improves README readability
Adds a newline to the README file for better visual separation
between the contribute button and the horizontal rule.
2025-09-13 19:55:23 +03:00
1a3376fe6c Improves button aesthetics on README
Adds whitespace to the buttons displayed on the README to improve their appearance.
2025-09-13 19:53:09 +03:00
20188d7043 Updates README with gallery, install and usage
Enhances the README by adding a gallery showcasing OMath's capabilities,
providing a clearer installation guide, and improving usage examples
to facilitate easier adoption.
Also restructures the navigation for better user experience.
2025-09-13 19:50:58 +03:00
f59e0d255f Update README.md 2025-09-13 19:20:37 +03:00
071cb15492 Update README.md 2025-09-13 19:16:19 +03:00
f8812ed9e7 Update README.md 2025-09-09 22:15:00 +03:00
19d310d35f Update README.md 2025-09-09 21:48:54 +03:00
5 changed files with 71 additions and 35 deletions

BIN
.github/images/yt_previews/img.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

View File

@@ -12,9 +12,24 @@
[![discord badge](https://dcbadge.limes.pink/api/server/https://discord.gg/eDgdaWbqwZ?style=flat)](https://discord.gg/eDgdaWbqwZ)
[![telegram badge](https://img.shields.io/badge/Telegram-2CA5E0?style=flat-squeare&logo=telegram&logoColor=white)](https://t.me/orangennotes)
OMath is a 100% independent, constexpr template blazingly fast math library that doesn't have legacy C++ code.
It provides the latest features, is highly customizable, has all for cheat development, DirectX/OpenGL/Vulkan support, premade support for different game engines, much more constexpr stuff than in other libraries and more...
<br>
<br>
---
**[<kbd><br>Install<br></kbd>][INSTALL]**
**[<kbd><br>Examples<br></kbd>][EXAMPLES]**
**[<kbd><br>Contribute<br></kbd>][CONTRIBUTING]**
---
<br>
</div>
Oranges's Math Library (omath) is a comprehensive, open-source library aimed at providing efficient, reliable, and versatile mathematical functions and algorithms. Developed primarily in C++, this library is designed to cater to a wide range of mathematical operations essential in scientific computing, engineering, and academic research.
<div align = center>
<a href="https://www.star-history.com/#orange-cpp/omath&Date">
@@ -36,6 +51,29 @@ Oranges's Math Library (omath) is a comprehensive, open-source library aimed at
- **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!
# Gallery
<br>
[![Youtube Video](.github/images/yt_previews/img.png)](https://youtu.be/lM_NJ1yCunw?si=-Qf5yzDcWbaxAXGQ)
<br>
![APEX Preview]
<br>
![BO2 Preview]
<br>
![CS2 Preview]
<br>
<br>
## Supported Render Pipelines
| ENGINE | SUPPORT |
|----------|---------|
@@ -53,9 +91,6 @@ Oranges's Math Library (omath) is a comprehensive, open-source library aimed at
| Linux | ✅YES |
| Darwin (MacOS) | ✅YES |
## ⏬ Installation
Please read our [installation guide](https://github.com/orange-cpp/omath/blob/main/INSTALL.md). If this link doesn't work check out INSTALL.md file.
## ❔ Usage
ESP example
```c++
@@ -77,26 +112,16 @@ for (auto ent: apex_sdk::EntityList::GetAllEntities())
// esp rendering...
}
```
## Showcase
<details>
<summary>OMATH for making cheats (click to open)</summary>
With `omath/projection` module you can achieve simple ESP hack for powered by Source/Unreal/Unity engine games, like [Apex Legends](https://store.steampowered.com/app/1172470/Apex_Legends/).
![banner](.github/images/showcase/apex.png)
Or for InfinityWard Engine based games. Like Call of Duty Black Ops 2!
![banner](.github/images/showcase/cod_bo2.png)
Or create simple trigger bot with embeded traceline from omath::collision::LineTrace
![banner](.github/images/showcase/cs2.jpeg)
Or even advanced projectile aimbot
[Watch Video](https://youtu.be/lM_NJ1yCunw?si=5E87OrQMeypxSJ3E)
</details>
## 🫵🏻 Contributing
Contributions to `omath` are welcome! Please read `CONTRIBUTING.md` for details on our code of conduct and the process for submitting pull requests.
## 📜 License
This project is licensed under the ZLIB - see the `LICENSE` file for details.
## 💘 Acknowledgments
- [All contributors](https://github.com/orange-cpp/omath/graphs/contributors)
<!----------------------------------{ Images }--------------------------------->
[APEX Preview]: .github/images/showcase/apex.png
[BO2 Preview]: .github/images/showcase/cod_bo2.png
[CS2 Preview]: .github/images/showcase/cs2.jpeg
<!----------------------------------{ Buttons }--------------------------------->
[INSTALL]: INSTALL.md
[CONTRIBUTING]: CONTRIBUTING.md
[EXAMPLES]: examples

View File

@@ -5,8 +5,8 @@
#pragma once
#include "omath/angles.hpp"
#include <algorithm>
#include <utility>
#include <format>
#include <utility>
namespace omath
{
@@ -150,17 +150,22 @@ namespace omath
}
};
} // namespace omath
template<class Type, Type min, Type max, omath::AngleFlags flags>
struct std::formatter<omath::Angle<Type, min, max, flags>> // NOLINT(*-dcl58-cpp)
template<class T, T MinV, T MaxV, omath::AngleFlags F, class CharT>
struct std::formatter<omath::Angle<T, MinV, MaxV, F>, CharT>
{
using AngleT = omath::Angle<T, MinV, MaxV, F>;
[[nodiscard]]
static constexpr auto parse(std::format_parse_context& ctx)
static constexpr auto parse(std::basic_format_parse_context<CharT>& ctx)
-> std::basic_format_parse_context<CharT>::iterator
{
return ctx.begin();
}
[[nodiscard]]
static auto format(const omath::Angle<Type, min, max, flags>& deg, std::format_context& ctx)
template<class FormatContext>
auto format(const AngleT& deg, FormatContext& ctx) const
{
return std::format_to(ctx.out(), "{}deg", deg.as_degrees());
if constexpr (std::is_same_v<typename FormatContext::char_type, char>)
return std::format_to(ctx.out(), "{}deg", deg.as_degrees());
return std::format_to(ctx.out(), L"{}deg", deg.as_degrees());
}
};

View File

@@ -15,7 +15,6 @@
#include "omath/linear_algebra/vector3.hpp"
// Matrix classes
#include "linear_algebra/matrix.hpp"
#include "omath/linear_algebra/mat.hpp"
// Color functionality
@@ -81,4 +80,4 @@
#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"
#include "omath/engines/unreal_engine/traits/pred_engine_trait.hpp"

View File

@@ -195,7 +195,14 @@ namespace omath::projection
[[nodiscard]]
std::expected<Vector3<float>, Error> screen_to_world(const Vector3<float>& screen_pos) const noexcept
{
return view_port_to_screen(screen_to_dnc(screen_pos));
return view_port_to_screen(screen_to_ndc(screen_pos));
}
[[nodiscard]]
std::expected<Vector3<float>, Error> screen_to_world(const Vector2<float>& screen_pos) const noexcept
{
const auto& [x, y] = screen_pos;
return screen_to_world({x, y, 1.f});
}
protected:
@@ -234,7 +241,7 @@ namespace omath::projection
return {(ndc.x + 1.f) / 2.f * m_view_port.m_width, (1.f - ndc.y) / 2.f * m_view_port.m_height, ndc.z};
}
[[nodiscard]] Vector3<float> screen_to_dnc(const Vector3<float>& screen_pos) const noexcept
[[nodiscard]] Vector3<float> screen_to_ndc(const Vector3<float>& screen_pos) const noexcept
{
return {screen_pos.x / m_view_port.m_width * 2.f - 1.f, 1.f - screen_pos.y / m_view_port.m_height * 2.f,
screen_pos.z};