feat: add bullet3 collision system - #24
Merged
Merged
Conversation
LoayAhmed304
force-pushed
the
feat/initial-collision
branch
from
April 13, 2026 18:32
59fe0c8 to
71fbd3a
Compare
There was a problem hiding this comment.
Pull request overview
Integrates a Bullet3-backed collision system into the game loop, adding collider layers and exposing query helpers (raycast/overlap) for gameplay usage.
Changes:
- Add
CollisionSystem(Bullet collision world integration) with per-frame collision events + basic pushback. - Extend
ColliderComponentwithCollisionLayerand layer parsing from JSON. - Wire collision system lifecycle into
Playstateand add a sample collision-focused scene config.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/states/play-state.hpp | Initializes, updates, and destroys the new collision system as part of the play loop. |
| src/game/systems/collision-system.hpp | Declares collision system API (update, raycast, overlapSphere) and event/result structs. |
| src/game/systems/collision-system.cpp | Implements Bullet world sync, contact extraction, pushback, raycast, and overlapSphere. |
| src/game/components/collider.hpp | Adds bitmask-based collision layers and updates ColliderComponent to use them. |
| src/game/components/collider.cpp | Adds JSON string → CollisionLayer parsing. |
| config/json-configs/collision.jsonc | Adds a sample scene demonstrating capsule/sphere colliders and layers. |
| CMakeLists.txt | Adds the collision system source to the build. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
AhmedSobhy01
previously approved these changes
Apr 17, 2026
AhmedSobhy01
left a comment
Collaborator
There was a problem hiding this comment.
Thank you sir, great addition!
Let's close this, but keep in mind we still have issues with changing scaling during runtime and also with parent scaling.
AhmedSobhy01
approved these changes
Apr 17, 2026
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.

Most important things to notice
raycast()function that takes target type and max distance and returns the first entity it hits of the specified type. This may be used in shooting to get the shot enemy entity (call raycast on left mouse click)