mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-12 22:53:27 +00:00
0b663b73d53817dba8993f2d4c9b1992cc7f5d4a
Adds helper functions to address near-zero vectors and find perpendicular directions. This prevents potential crashes and improves robustness when the origin lies on the line defined by the simplex edges during GJK collision detection.
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...
Install
Examples
Documentation
Contribute
Donate
🚀 Quick Example
#include <omath/omath.hpp>
using namespace omath;
// 3D vector operations
Vector3<float> a{1, 2, 3};
Vector3<float> b{4, 5, 6};
auto dot = a.dot(b); // 32.0
auto cross = a.cross(b); // (-3, 6, -3)
auto distance = a.distance_to(b); // ~5.196
auto normalized = a.normalized(); // Unit vector
// World-to-screen projection (Source Engine example)
using namespace omath::source_engine;
Camera camera(position, angles, viewport, fov, near_plane, far_plane);
if (auto screen = camera.world_to_screen(world_position)) {
// Draw at screen->x, screen->y
}
➡️ See more examples and tutorials
✨ Features
- 🚀 Efficiency: Optimized for performance, ensuring quick computations using AVX2.
- 🎯 Versatility: Includes a wide array of mathematical functions and algorithms.
- ✅ Ease of Use: Simplified interface for convenient integration into various projects.
- 🎮 Projectile Prediction: Projectile prediction engine with O(N) algo complexity, that can power you projectile aim-bot.
- 📐 3D Projection: No need to find view-projection matrix anymore you can make your own projection pipeline.
- 💥 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
- 🔧 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, Frostbite, IWEngine and canonical OpenGL.
- 🌍 Cross platform: Supports Windows, MacOS and Linux.
- 🔍 Algorithms: Has ability to scan for byte pattern with wildcards in PE files/modules, binary slices, works even with Wine apps.
📚 Documentation
- Getting Started Guide - Installation and first steps
- API Overview - Complete API reference
- Tutorials - Step-by-step guides
- FAQ - Common questions and answers
- Troubleshooting - Solutions to common issues
- Best Practices - Guidelines for effective usage
🤝 Community & Support
- Discord: Join our community
- Telegram: @orangennotes
- Issues: Report bugs or request features
- Contributing: See CONTRIBUTING.md for guidelines
💘 Acknowledgments
Description
Cross-platform modern general purpose math library written in C++23 that suitable for cheat/game development.
https://libomath.org
3dcheatcheat-developmentcpp23game-developmentgame-hackinggamedeviwmathmatrixesopenglopengl3physicsprojectile-motion-simulationsource-engineunityunity3dunreal-engine
Readme
Zlib
14 MiB
Languages
C++
94%
CMake
4.1%
Shell
1.4%
Lua
0.5%





