Updates the `Triangle` class to use a generic `Vector` type instead of `Vector3`, enhancing flexibility and reusability.
Changes include updating relevant function return types to use `Vector::ContainedType` and adapting length and distance calculations accordingly.
This refactoring supports the ongoing work on the EPA algorithm (feature/epa_algorithm) by providing a more adaptable foundation for geometric calculations.
Introduces `GjkHitInfo` to encapsulate collision results, including the simplex.
Refactors `is_collide` to return the `GjkHitInfo` struct, providing more detailed collision data. This prepares the codebase for integrating the EPA algorithm (as per the feature branch) which requires simplex information.
Simplifies the GJK algorithm by using a type alias for the vertex type, improving code readability and reducing redundancy. Removes unnecessary includes.
Applies the `[[nodiscard]]` attribute to several functions within the `omath::collision` namespace to improve code safety and signal potential misuse when return values are ignored. This encourages developers to handle the results of these functions appropriately.
Simplifies Simplex initialization and accessors.
Ensures correct handling of collinearity within the simplex calculation, preventing issues when colliders share the same origin. This improves stability and reliability of the GJK algorithm.
Reorders the transform application to translation, scale, then rotation.
This ensures the collider’s world matrix is constructed correctly, preventing potential scaling or rotation issues in the GJK algorithm being developed on this branch.
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.
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.
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.
Updates simplex handling to use references for vertex access, avoiding unnecessary copies. This improves performance and clarity within the GJK algorithm.
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.
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.
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.
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.
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.
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.
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.
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.
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`.
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.
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.