Commit Graph

60 Commits

Author SHA1 Message Date
orange 9d5984093d 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
orange 3d130fd1fb 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
orange f1ee6e9e35 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
orange 63debc635e fixed for mac improved readability 2025-10-08 19:22:20 +03:00
orange 007340edaa 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
orange 932b0d8deb 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
orange 64e6ba3632 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
orange 544fa313c1 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
orange d0684c388e finished test 2025-10-04 10:04:34 +03:00
orange 70f2f90100 reordored omath headers 2025-10-03 13:51:53 +03:00
orange 1d8dba6487 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
orange 18b0b210cf 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
orange 9e08f5bb5c 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
orange 1efa28d676 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
orange 55c5bb92da 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
orange 1c58340404 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
orange abf068262d 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
orange e6627c7a06 Improves test accuracy and adds .gitignore entry
Updates unit tests to include more accurate assertions for camera projections.

Adds .idea/workspace.xml to .gitignore to prevent tracking local IDE settings.

Refactors some test fixture class names for consistency.
2025-08-21 00:30:05 +03:00
orange 07de3d27ec Configures project IDE settings and improves gitignore
Adds project-specific IDE settings to improve code style consistency and development environment.

Removes the .idea directory from the .gitignore file, as these files are now intended to be part of the project for consistent IDE configuration across contributors.
2025-08-21 00:11:37 +03:00
orange 24a80c4f14 Adds comparison operators to Vector types
Adds less than, greater than, less than or equal, and greater than or equal operators to the Vector2, Vector3 and Vector4 classes.
The comparison is based on the lengths of the vectors.

Adds corresponding unit tests.
2025-08-12 08:54:33 +03:00
orange 0fe5b6b7a1 Enables legacy code compilation
The changes encapsulate the matrix tests within an `#ifdef` block, allowing conditional compilation based on whether `OMATH_ENABLE_LEGACY` is defined. This enables the legacy code to be compiled only when needed.
2025-07-15 11:51:14 +03:00
orange e68ca673c9 Renames test fixture for clarity.
Updates the name of the test fixture from "lline_tracer_fixture" to "line_tracer_fixture" for improved readability and consistency in the test code.
2025-07-07 08:28:29 +03:00
orange 77bf19da2d Fixes potential compile error
Corrects the usage of `At` method within the unit tests to `at` to resolve a potential compile error due to incorrect case sensitivity.
2025-07-07 08:18:00 +03:00
orange 63d9ea903e fixed naming in tests 2025-07-07 08:02:35 +03:00
orange 6df9d59fe9 fixed style 2025-05-03 20:38:58 +03:00
orange 4406e1e461 changed code style 2025-05-03 20:31:59 +03:00
orange 4dbddd0a34 style fix 2025-04-29 20:52:41 +03:00
orange ef787fd4e7 added test case 2025-04-29 20:49:59 +03:00
orange 468261d3f1 added additional methods 2025-04-29 20:10:17 +03:00
orange 6d65e1f1c3 improved tests 2025-04-18 16:36:22 +03:00
Vladislav Alpatov 6a7d328a7c improved line tracer 2025-04-18 16:00:23 +03:00
orange 505a8cce9a added new build option 2025-04-18 00:51:07 +03:00
orange 5ff57f9ffa added box 2025-04-18 00:43:46 +03:00
orange 582a591e4b fixed tests 2025-04-12 00:04:07 +03:00
orange 7e580506b6 fixed style 2025-03-29 04:00:35 +03:00
orange d8c653d730 fixed tests includes 2025-03-21 04:58:28 +03:00
orange d5d1260784 changed source files naming 2025-03-21 04:30:17 +03:00
Vladislav Alpatov 5fdf3dad16 renamed headers 2025-03-21 04:17:42 +03:00
orange dbd7eb7d5f improved print method 2025-03-19 00:56:56 +03:00
orange 3c104cd228 changed naming of engines section 2025-03-17 05:27:00 +03:00
Vladislav Alpatov a68ebd9ab7 now template 2025-03-01 21:11:46 +03:00
orange c9bc1864bb added legacy impl 2025-02-23 10:10:35 +03:00
orange c42a523e6c added more classes 2025-02-23 09:57:29 +03:00
orange 9cbf042173 added AVX2 2025-02-22 23:34:45 +03:00
orange e789c716d1 added new method added concept for mat type 2025-02-16 10:06:04 +03:00
orange e007b15cc9 fix 2025-01-06 05:15:12 +03:00
orange e722a29e6f added some methods 2025-01-06 05:08:32 +03:00
orange 51d75bb7ec improvement 2025-01-06 04:42:43 +03:00
orange bb812c6837 added method + tests 2025-01-02 12:52:34 +03:00
orange a68007a1f4 added methods 2024-12-23 15:34:38 +03:00