Skip to content

Conversation

@orange-cpp
Copy link
Owner

No description provided.

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.
@orange-cpp orange-cpp merged commit 9efabd8 into main Nov 9, 2025
4 checks passed
@orange-cpp orange-cpp deleted the feature/gjk_algorithm branch November 9, 2025 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants