mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 15:03:27 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8feb805067 | |||
| 816da38987 | |||
| 0ba795c767 | |||
| 88b709f531 | |||
| a7eacb529e |
2
LICENSE
2
LICENSE
@@ -16,7 +16,7 @@ freely, subject to the following restrictions:
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
4. If you are an employee, contractor, volunteer, representative,
|
||||
or have any other affiliation (past, present, or future)
|
||||
or have any other affiliation (past or present)
|
||||
with any of the following entities:
|
||||
* "Yandex" LLC
|
||||
* "Rutube" LLC
|
||||
|
||||
@@ -52,7 +52,7 @@ 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.
|
||||
- **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, IWEngine and canonical OpenGL.
|
||||
- **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.
|
||||
<div align = center>
|
||||
|
||||
@@ -76,6 +76,14 @@
|
||||
#include "omath/engines/unity_engine/traits/camera_trait.hpp"
|
||||
#include "omath/engines/unity_engine/traits/pred_engine_trait.hpp"
|
||||
|
||||
//Frostbite Engine
|
||||
#include "omath/engines/frostbite_engine/constants.hpp"
|
||||
#include "omath/engines/frostbite_engine/formulas.hpp"
|
||||
#include "omath/engines/frostbite_engine/camera.hpp"
|
||||
#include "omath/engines/frostbite_engine/traits/camera_trait.hpp"
|
||||
#include "omath/engines/frostbite_engine/traits/pred_engine_trait.hpp"
|
||||
|
||||
|
||||
// Unreal Engine
|
||||
#include "omath/engines/unreal_engine/constants.hpp"
|
||||
#include "omath/engines/unreal_engine/formulas.hpp"
|
||||
|
||||
@@ -238,10 +238,8 @@ namespace omath::projection
|
||||
return std::ranges::any_of(ndc.raw_array(), [](const auto& val) { return val < -1 || val > 1; });
|
||||
}
|
||||
|
||||
[[nodiscard]] Vector3<float>
|
||||
ndc_to_screen_position_from_top_left_corner(const Vector3<float>& ndc) const noexcept
|
||||
{
|
||||
/*
|
||||
// NDC REPRESENTATION:
|
||||
/*
|
||||
^
|
||||
| y
|
||||
1 |
|
||||
@@ -254,6 +252,20 @@ namespace omath::projection
|
||||
v
|
||||
*/
|
||||
|
||||
[[nodiscard]] Vector3<float>
|
||||
ndc_to_screen_position_from_top_left_corner(const Vector3<float>& ndc) const noexcept
|
||||
{
|
||||
/*
|
||||
+------------------------>
|
||||
| (0, 0)
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
⌄
|
||||
*/
|
||||
return {(ndc.x + 1.f) / 2.f * m_view_port.m_width, (ndc.y / -2.f + 0.5f) * m_view_port.m_height, ndc.z};
|
||||
}
|
||||
|
||||
@@ -261,18 +273,16 @@ namespace omath::projection
|
||||
ndc_to_screen_position_from_bottom_left_corner(const Vector3<float>& ndc) const noexcept
|
||||
{
|
||||
/*
|
||||
^
|
||||
| y
|
||||
1 |
|
||||
|
|
||||
|
|
||||
-1 ---------0--------- 1 --> x
|
||||
|
|
||||
|
|
||||
-1 |
|
||||
v
|
||||
*/
|
||||
|
||||
^
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
| (0, 0)
|
||||
+------------------------>
|
||||
*/
|
||||
return {(ndc.x + 1.f) / 2.f * m_view_port.m_width, (ndc.y / 2.f + 0.5f) * m_view_port.m_height, ndc.z};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user