Commit Graph

854 Commits

Author SHA1 Message Date
d8d585e3eb Refactors triangle calculations for generic vectors
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.
2025-11-13 15:29:10 +03:00
ce1142dac9 Adds GjkHitInfo and refactors collision detection
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.
2025-11-13 13:33:18 +03:00
12d11f3e8c Refactors GJK algorithm vertex type
Simplifies the GJK algorithm by using a type alias for the vertex type, improving code readability and reducing redundancy. Removes unnecessary includes.
2025-11-11 23:37:56 +03:00
f5b083a0da Adds nodiscard attribute to simplex functions
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.
2025-11-11 23:36:19 +03:00
58c80d7ec4 Refactors perpendicular vector selection
Simplifies logic for finding a non-zero perpendicular vector by iterating through candidate directions. This improves readability and maintainability.
2025-11-11 23:34:30 +03:00
ee955a7ac2 Merge pull request #102 from orange-cpp/feature/gjk_algorithm
Feature/gjk algorithm
v4.3.0
2025-11-09 23:27:03 +03:00
9783a63c9b forgot keyname 2025-11-09 23:23:13 +03:00
369f2ee582 added other collision types 2025-11-09 22:39:09 +03:00
7d6309c0dd style fix 2025-11-09 22:27:04 +03:00
8f1998b0c5 removed redundant headers 2025-11-09 22:25:29 +03:00
8e332f3979 fixed formating 2025-11-09 22:22:02 +03:00
353fb290b7 added mesh class, added mesh trair 2025-11-09 22:10:56 +03:00
4fe001b102 add mesh class 2025-11-09 21:28:00 +03:00
71f59406a9 Refactors Simplex class for GJK algorithm
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.
2025-11-09 17:29:50 +03:00
a9d60675f3 Corrects transform order for collider
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.
2025-11-09 17:15:01 +03:00
14296e45c4 fix 2025-11-09 17:09:46 +03:00
7f62cb6db3 Auto stash before checking out "origin/feature/gjk_algorithm" 2025-11-09 17:08:57 +03:00
e1ff9efc91 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
c20bfe1f8c 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
1dbaa4d53b Handles collinear cases in simplex collision
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.
2025-11-09 16:56:38 +03:00
8875157c79 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
82e78016e3 made final 2025-11-09 15:51:28 +03:00
1aa0360ac4 fix 2025-11-09 15:50:07 +03:00
bbd181f12f updated 2025-11-09 15:39:11 +03:00
c0353cd9be updated test 2025-11-09 15:38:38 +03:00
da2d51be6d 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
727a9cc07e patch 2025-11-09 14:23:34 +03:00
b33288555a 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
4c525d5c31 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
5c81533c06 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
8f054316fc 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
6873f355b8 Merge pull request #101 from orange-cpp/feature/added_pe_scan_example
Adds PE signature scanner example
2025-11-08 14:38:17 +03:00
47b16a4fea Adds PE signature scanner example
Implements a basic example demonstrating how to scan for a given pattern within a PE file.

The example takes a file path, section, and signature as input and utilizes the `omath::PePatternScanner` to locate the signature within the specified section of the PE file.
2025-11-08 14:34:14 +03:00
fd889aabcc Merge pull request #100 from orange-cpp/feature/improved_scree_to_world
Improves screen to world conversion accuracy
2025-11-08 13:54:44 +03:00
8aa2dca456 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
3d4d9c0bbf Update documentation links from HTTPS to HTTP 2025-11-08 07:43:28 +03:00
dc799281dd removed old banner 2025-11-03 17:17:54 +03:00
b6304b79f5 Merge pull request #99 from luadebug/macosx
Add macOS CI workflow and update CMake presets for vcpkg integration
2025-11-01 16:53:27 +03:00
Saikari
be56fbf408 Add macOS CI workflow and update CMake presets for vcpkg integration 2025-11-01 16:44:40 +03:00
049f0843af upgraded version v4.2.0 2025-11-01 14:07:06 +03:00
8bf416d513 patch 2025-11-01 13:39:13 +03:00
9f05b36388 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
d2c13b5024 Merge pull request #96 from orange-cpp/feature/docs
Feature/docs
2025-11-01 13:07:58 +03:00
b963bd1af6 Renames documentation titles for consistency
Updates several documentation titles to a more consistent format.
Changes include renaming "Frequently Asked Questions (FAQ)" to "FAQ",
"Getting Started with OMath" to "Getting Started",
"Troubleshooting Guide" to "Troubleshooting", and
"OMath Tutorials" to "Tutorials".
```
2025-11-01 13:00:32 +03:00
6e6cda0d80 Removes dark overrides CSS file
Deletes the `dark-overrides.css` file.

This file appears to have been superseded by other theming mechanisms and is no longer needed. Its presence was causing potential conflicts.
2025-11-01 12:57:33 +03:00
50961b1137 Merge pull request #98 from orange-cpp/copilot/sub-pr-96
Comprehensive documentation overhaul with guides, tutorials, and cross-references
2025-11-01 12:56:05 +03:00
copilot-swe-agent[bot]
692b21b1dc Improve documentation with cross-references and README enhancements
Co-authored-by: orange-cpp <59374393+orange-cpp@users.noreply.github.com>
2025-11-01 09:54:08 +00:00
copilot-swe-agent[bot]
01523f79b2 Add comprehensive documentation improvements
Co-authored-by: orange-cpp <59374393+orange-cpp@users.noreply.github.com>
2025-11-01 09:51:38 +00:00
copilot-swe-agent[bot]
41a662d13f Initial plan 2025-11-01 09:40:43 +00:00
d169689273 Merge pull request #97 from orange-cpp/copilot/sub-pr-96
Add documentation for game engine math modules
2025-11-01 12:40:09 +03:00