-
Notifications
You must be signed in to change notification settings - Fork 11
Feature/gjk algorithm #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
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.
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 simplex handling to use references for vertex access, avoiding unnecessary copies. This improves performance and clarity within the GJK algorithm.
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.
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.
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.
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.
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.
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.