Commit Graph

319 Commits

Author SHA1 Message Date
015fc9b1e7 made final 2025-11-09 15:51:28 +03:00
62d1a615ae fix 2025-11-09 15:50:07 +03:00
043b5c588d updated 2025-11-09 15:39:11 +03:00
cd18b088cb updated test 2025-11-09 15:38:38 +03:00
ebfdd0b70e Refactors simplex handling in GJK algorithm
Updates simplex handling to use references for vertex access, avoiding unnecessary copies. This improves performance and clarity within the GJK algorithm.
2025-11-09 14:40:22 +03:00
e7b82f441c patch 2025-11-09 14:23:34 +03:00
6e59957247 Adds mat_scale function
Introduces a utility function to create a scaling matrix from a Vector3.
This simplifies the creation of scale transformations, particularly useful for the GJK algorithm implementation.
2025-11-09 14:19:08 +03:00
1e540862a0 Refactors GJK tetrahedron handling
Updates the `handle_tetrahedron` function to use const references for simplex points, improving efficiency and readability.

Corrects a potential bug where the `simplex` variable wasn't being correctly updated when recursively calling `handle_triangle`.

Also, const-qualifies `point_to_same_direction` for better safety.
2025-11-09 14:15:32 +03:00
31cc1116ae Updates simplex iterator and size access
Changes the index type for accessing simplex points to `std::size_t` for consistency and safety.

Adds `[[nodiscard]]` attribute to `size()` and iterator functions to signal potential misuse and enable static analysis.

These updates are part of the GJK algorithm implementation.
2025-11-09 14:05:46 +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
d894b62773 patch 2025-11-01 13:39:13 +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
eec34c1efb removed brackets
Initial plan

Initial exploration and analysis complete

Co-authored-by: orange-cpp <59374393+orange-cpp@users.noreply.github.com>

Optimize performance: A* pathfinding, Vector3 hash, pattern scanner, AVX2 code, and serialization

Co-authored-by: orange-cpp <59374393+orange-cpp@users.noreply.github.com>

Add bounds check for navigation mesh serialization

Co-authored-by: orange-cpp <59374393+orange-cpp@users.noreply.github.com>

Document serialization limitation for large neighbor counts

Co-authored-by: orange-cpp <59374393+orange-cpp@users.noreply.github.com>

Add _codeql_build_dir to gitignore

Co-authored-by: orange-cpp <59374393+orange-cpp@users.noreply.github.com>

Removes codeql detected source root

Eliminates the automatically generated file that was causing issues.

This file was added by codeql and no longer needed.

revert
cleaned up gitignore

moved to anon namespace

Improves navigation mesh serialization and clamping

Ensures correct serialization of navigation meshes by clamping neighbor counts to prevent data corruption when exceeding uint16_t limits.

Updates data types to `std::uint8_t` and `std::size_t` for consistency.
Uses `std::copy_n` instead of `std::memcpy` for deserialization.
2025-10-30 05:38:58 +03:00
8adf5db409 added vcpkg manifest file 2025-10-23 06:35:22 +03:00
2c7e443f52 added contained type alias 2025-10-23 06:26:57 +03:00
816da38987 added frostbite into global header 2025-10-23 00:55:49 +03:00
88b709f531 deleted not needed header 2025-10-23 00:49:54 +03:00
a7eacb529e updated comments 2025-10-23 00:48:54 +03:00
404c7de594 added frostbite sources 2025-10-23 00:08:17 +03:00
f26f48cc53 Defines constants for Frostbite engine
Introduces a constants header file for the Frostbite engine,
including common vectors, matrices, and angle types.
This provides a centralized location for defining and accessing
essential mathematical constants used throughout the engine.
2025-10-21 04:56:49 +03:00
570c035f27 added second method of w2s 2025-10-21 04:38:43 +03:00
5657282577 Fixes incorrect NDC calculation and updates formulas
Corrects the NDC calculation in `world_to_screen` to improve accuracy.
Replaces custom perspective projection matrix calculation with `omath::mat_perspective_right_handed` for correctness and consistency.
Updates test cases and provides debugging information by printing view and projection matrices.
Addresses an issue in the feature/ndc_invalid_calc_fix branch.
2025-10-21 04:38:43 +03:00
8dadb22e75 Removes ReSharper disable comments
Removes the `ReSharper disable CppInconsistentNaming` comments
from the header file.
2025-10-14 13:23:09 +03:00
8dd9860aa1 Adds PE pattern scan utility
Includes a new utility for scanning PE patterns.
2025-10-14 13:20:14 +03:00
eb8688c90c Unifies orthographic matrix generation
Consolidates the generation of left-handed and right-handed orthographic matrices into a shared implementation to reduce code duplication.
2025-10-14 13:06:23 +03:00
9f2f619a21 Adds hash support for Vector2, Vector3, and Vector4
Implements `std::hash` specialization for `omath::Vector2`, `omath::Vector3`, and `omath::Vector4` with float components.

This enables usage of these vector types as keys in hash-based containers, such as `std::unordered_map` and `std::unordered_set`.
2025-10-14 13:00:28 +03:00
5646654317 Removes Windows-specific API dependencies for pattern scanning
Replaces calls to Windows API functions (GetModuleHandleA) with a void pointer parameter.

Simplifies pattern scanning for loaded modules by removing Windows-specific code and replacing it with a generic approach.
2025-10-13 14:17:30 +03:00
7b0af9cf66 Removes unnecessary code in PE scanner
Simplifies the PePatternScanner class by removing extraneous code.
This cleans up the codebase and improves readability.
2025-10-12 20:00:52 +03:00
cd0a864e7c Refactors PE scanner to eliminate redundant section extraction
Simplifies the PE pattern scanner by removing the redundant `extract_section_from_pe_file` function.

The extracted data is now returned directly from a new `ExtractedSection` struct within the main scanning function, streamlining the code and reducing duplication. This improves readability and maintainability of the PE scanner.
2025-10-12 19:53:41 +03:00
37f624956b Removes PE definition files
Removes the PE definition files and related functions as they are no longer needed.
2025-10-12 19:41:18 +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
Saikari
e385686323 Update internal_rev_object.hpp 2025-10-09 21:34:19 +03:00
9419e390da Allows specifying target section for file scan
Enables users to specify the target section name when scanning a PE file for a pattern.
This provides more flexibility in locating patterns within a PE file, as it's not limited to the ".text" section.
2025-10-09 20:42:03 +03:00
6c5152297a Uses correct calling convention for virtual methods
Adjusts the virtual method calling convention based on the compiler (_MSC_VER).
This ensures compatibility and correct behavior on different platforms.
2025-10-09 20:08:04 +03:00
3129e32f0c Uses std::uint16_t for SubsystemId enum
Ensures consistency by using `std::uint16_t` instead of `uint16_t` for the `SubsystemId` enum.

Relates to feature/pe_scanner
2025-10-09 20:01:34 +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
8eda1ce4bc Adds PE scanner infrastructure and data structures
Initializes infrastructure for PE file scanning.

Adds data structures for PE headers (DOS, optional, section),
including user-defined types for section characteristics.

Refactors existing pattern scanning code to utilize new PE data structures.

Adds basic parsing of PE headers.
2025-10-08 19:22:20 +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
d64c7ad756 Adds PE section extraction and pattern scanning
Adds functionality to extract a specific section from a PE file and scan for a given pattern within that section.

Introduces `extract_section_from_pe_file` to isolate a section, enabling more targeted pattern searches.
Overhauls `scan_for_pattern_in_file` to utilize extracted section data and improve accuracy.
2025-10-08 19:22:20 +03:00
f3fe0e3cee added pe pattern scan 2025-10-08 19:22:20 +03:00
a7cb056ce7 Moves PE headers file to omath directory
Organizes the project by relocating the PE headers file to the omath directory structure.
This improves code organization and maintainability.
2025-10-08 19:22:20 +03:00
e35d64b486 Disables rvalue overload of scan_for_pattern
Prevents implicit conversions and unexpected behavior by deleting the rvalue overload of `scan_for_pattern`.
2025-10-06 15:05:04 +03:00
9868c832a1 Corrects function signature
Adjusts the `scan_for_pattern` function signature to correctly use `const std::string_view&`.
2025-10-06 14:46:40 +03:00
42e46f9921 added global header 2025-10-06 14:36:00 +03:00
e7ccc2ead0 added concept for iterators, reworked interface 2025-10-06 14:25:52 +03:00
170f969697 improved scanner interface 2025-10-06 14:21:52 +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