Collision System Collider enabled checks added.#75
Merged
Conversation
Refactor: CollisionHandler Query-,Cast-, and IntersectSpace functions now correctly check if collider used is enabled. SpatialHash certain functions that work with colliders are now correctly checking if the collider is enabled.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR ensures that disabled colliders are skipped in spatial hash operations and collision handler queries.
- Added early
Enabledchecks inSpatialHashmethods - Introduced
Enabledguards and updated XML docs inCollisionHandlerqueries
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| ShapeEngine/Geometry/CollisionSystem/SpatialHash.cs | Early-return if collider.Enabled is false in registration, candidate and add methods |
| ShapeEngine/Geometry/CollisionSystem/CollisionHandler.cs | Guards against disabled colliders in IntersectSpace, CastSpace and updated parameter docs |
Comments suppressed due to low confidence (2)
ShapeEngine/Geometry/CollisionSystem/CollisionHandler.cs:650
- [nitpick] Replace the exclamation mark with a period to maintain a formal tone in XML documentation.
/// <param name="collider">The collider to test for intersections. The collider needs to be enabled!</param>
ShapeEngine/Geometry/CollisionSystem/CollisionHandler.cs:658
- Add unit tests to verify that
IntersectSpacereturns null whencollider.Enabledis false.
if(!collider.Enabled) return null;
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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
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.
Refactor: CollisionHandler Query-,Cast-, and IntersectSpace functions now correctly check if collider used is enabled. Refactor: SpatialHash certain functions that work with colliders are now correctly checking if the collider is enabled.