Commit Graph

93 Commits

Author SHA1 Message Date
ffcf448a07 improved code style 2025-12-28 02:29:19 +03:00
88ce5e6b8c warning fix 2025-12-25 02:35:50 +03:00
29da13d244 Implement coverage for Windows/Linux/MacOS (#126) (#128)
* Implement coverage for Windows/Linux/MacOS (#126)

* reverted

---------

Co-authored-by: Saikari <lin@sz.cn.eu.org>
2025-12-25 02:28:17 +03:00
d935caf1a4 Feature/more constexpr (#125)
* added constexpr

* fix

* improved stuff

* added const

* improvement

* fix

* fix

* patch
2025-12-24 02:32:14 +03:00
897484bea1 Temp (#123)
* Coverage

* added fixes

* removed spacing

* removed junk

* removed print

* removed coverage

* removed useless stuff

* fix

---------

Co-authored-by: Saikari <lin@sz.cn.eu.org>
2025-12-23 02:47:12 +03:00
Saikari
4a8e7e85ce try 2025-12-21 22:57:38 +03:00
60a3a42140 improved pmr stuff 2025-12-13 00:06:45 +03:00
d7189eb7d4 added extra test 2025-12-09 10:16:57 +03:00
e05eba42c3 added collider interface 2025-12-06 13:56:25 +03:00
3685f13344 back to static 2025-12-03 13:34:35 +03:00
d4d8f70fff switched to shared_ptr 2025-12-03 13:30:05 +03:00
918858e255 added poly allocators 2025-12-03 09:52:53 +03:00
e54d5e7388 changed ebo type 2025-11-29 16:49:19 +03:00
99ebdeb188 added template arg to Vertex struct 2025-11-29 16:31:24 +03:00
ba267cbcb8 improved mesh class 2025-11-29 16:28:06 +03:00
0283935918 added std::optional 2025-11-13 21:25:45 +03:00
88d4447b20 add another test 2025-11-13 17:22:54 +03:00
ee458a24f7 fixed formating 2025-11-13 16:56:48 +03:00
fa91f21e39 Refactors collision detection with GJK and EPA
This commit refactors the collision detection pipeline to utilize a more standard GJK algorithm and simplifies the EPA implementation.

Removes the custom `GjkAlgorithmWithSimplex` in favor of the standalone `GjkAlgorithm`. This streamlines the collision detection process and enhances code clarity.

Updates unit tests to align with the new GJK implementation, ensuring continued functionality and correctness.
2025-11-13 16:39:26 +03:00
873bdd2036 Improves EPA test coverage
Adds a comprehensive unit test for the EPA algorithm,
validating collision detection, depth calculation, and
separation axis determination with a cube overlap scenario.

Refactors the test for clarity and robustness.
2025-11-13 16:34:14 +03:00
06b597f37c added epa 2025-11-13 15:57:38 +03:00
a3f45628aa fixed formating 2025-11-09 22:22:02 +03:00
6da44a5a51 added mesh class, added mesh trair 2025-11-09 22:10:56 +03:00
79482d56d1 fix 2025-11-09 17:09:46 +03:00
b2a512eafe Adds mesh scaling to mesh collider
Updates the mesh collider to include a scale parameter, allowing for non-uniform scaling of the collision mesh.

This provides more flexibility in defining collision shapes and supports a wider range of scenarios.
2025-11-09 17:02:07 +03:00
7b0e2127dc Adds GJK collision test with equal origins
Implements a new test case for the GJK algorithm
to verify collision detection when colliders share the same origin.
This enhances the robustness of collision detection in scenarios
where objects are positioned at the same location.
2025-11-09 16:57:52 +03:00
afc0720f08 Refactor: Simplify GJK simplex handling
Removes the separate `Simplex` class and integrates its functionality directly into the `GjkAlgorithm`. This simplifies the code and reduces unnecessary overhead.

Updates tests to align with refactored implementation.
2025-11-09 16:02:13 +03:00
cd18b088cb updated test 2025-11-09 15:38:38 +03:00
338246a618 Implements GJK collision detection
Adds GJK algorithm implementation for detecting collisions between mesh colliders.

Includes mesh collider definition and unit tests for basic collision detection.

Provides a foundation for more complex collision handling and physics interactions.
2025-11-09 14:04:01 +03:00
b48160e1b7 Improves screen to world conversion accuracy
Adds support for different screen origin configurations.

This change allows for more accurate conversion from screen coordinates to world coordinates by correctly handling different screen origin positions (top-left and bottom-left). Includes new unit tests to verify the functionality with both configurations.
2025-11-08 13:51:56 +03:00
ade281cdd2 Adds const version of rev_bar method
Adds a const overload for the `rev_bar` virtual method.
This allows calling the method on const instances of the reverse engineered class.
2025-11-01 13:28:51 +03:00
8adf5db409 added vcpkg manifest file 2025-10-23 06:35:22 +03:00
570c035f27 added second method of w2s 2025-10-21 04:38:43 +03:00
f6c607d84c Uses source engine camera trait for view angle calculation
Replaces the custom `view_angle_to` function with `omath::source_engine::CameraTrait::calc_look_at_angle` for vector3 view angle calculations.
This change aligns with source engine conventions and improves code consistency.
2025-10-11 15:46:52 +03:00
72b54e9673 Removes PE scanner test code
Eliminates the PE scanner test code from the unit tests.

This removes a test that appears to be broken or no longer relevant, since the test directly references a file path.
2025-10-09 19:58:58 +03:00
2ff291b255 Supports broader architectures in PE scanner
Updates the PE scanner implementation to support both 32-bit and 64-bit architectures.
Leverages `std::variant` and a generic `ImageNtHeaders` to abstract architecture-specific details.
Simplifies the logic for retrieving section data, generalizing the process for improved maintainability.
2025-10-09 19:58:19 +03:00
e1b4375621 fixed for mac improved readability 2025-10-08 19:22:20 +03:00
d84259fdcc Adds PE file header definitions
Defines `DosHeader` and `FileHeader` structures to represent PE file header information.
Includes definitions for `MachineId` enum and `FileCharacteristics` union.
These definitions are prerequisite for PE file parsing and analysis.
2025-10-08 19:22:20 +03:00
06f9a8c9ee Adds pattern scanning functionality and corner case tests
Implements a pattern scanning feature that allows searching for byte patterns within a byte range.

Adds `scan_for_pattern` method to `PatternScanner` to locate a pattern within a byte span.

Adds corner case tests to verify functionality and handle invalid inputs.
2025-10-05 06:37:20 +03:00
160b51da94 Adds corner case tests for pattern scanning
Adds new test cases to cover additional scenarios for pattern scanning, including tests for leading/trailing whitespace and spacing variations to ensure robustness.
2025-10-04 18:43:05 +03:00
f17d36dcd3 Adds pattern scanning functionality
Implements a pattern scanner for byte sequence parsing.

Introduces `omath::PatternScanner` to parse pattern strings, which represent byte sequences.
Adds support for wildcard characters ('?' and '?') to represent optional bytes in the pattern.
Includes unit tests for basic read operations to ensure proper functionality.
2025-10-04 18:30:43 +03:00
cbee8c2c95 finished test 2025-10-04 10:04:34 +03:00
1ef7833bd9 reordored omath headers 2025-10-03 13:51:53 +03:00
418b7c0e7e Fixes float type conversion in world_to_screen
Fixes a potential type conversion issue by explicitly casting the x-coordinate to float in the world_to_screen test. This prevents possible compiler warnings and ensures the intended behavior.
2025-09-09 02:13:45 +03:00
69f46abce1 Adds projection test for world-to-screen consistency
Adds a test to verify the consistency of world-to-screen and
screen-to-world projections. This ensures that projecting a point
from world to screen and back results in the same point, thereby
validating the correctness of the camera projection transformations.
2025-09-09 01:37:38 +03:00
de61f7a5d8 Adds screen to world space conversion
Adds functionality to convert screen coordinates to world space, including handling for cases where the inverse view projection matrix is singular or when the world position is out of screen bounds.

Also exposes Camera class to unit tests.
2025-09-09 01:31:23 +03:00
14fa810ecb Implements angle class with normalization
Adds an angle class with support for different normalization
and clamping strategies. Includes trigonometric functions and
arithmetic operators. Introduces unit tests to verify correct
functionality.

Disables unity builds to address a compilation issue.
2025-09-08 20:15:59 +03:00
9c11551c9a Removes deprecated Matrix class
Removes the deprecated `Matrix` class and its associated source files and unit tests.

This change is to ensure code cleanliness and prevent accidental usage of the slow and outdated `Matrix` class.
The `Mat` class should be used instead.
2025-09-08 19:56:04 +03:00
d74c66990a Refactors: Moves linear algebra to new directory
Moves linear algebra headers to a new subdirectory to improve project structure.

Updates includes to reflect the directory change.
Adds vcpkg to the tracked repositories.
2025-08-31 23:36:05 +03:00
115b5a3471 Adds std::format support for math types
Adds `std::formatter` specializations for `Mat`, `Vector2`, `Vector3`, and `Vector4` types, enabling the use of `std::format` for these types.

This simplifies formatting and printing of these mathematical objects, improving code readability and consistency.

Also adds a hash function specialization for Vector3.
2025-08-26 12:22:33 +03:00