Skip to content

refactor: generic collision handling#59

Merged
ripel2 merged 23 commits intomainfrom
33-generic-collision-handler
Nov 13, 2024
Merged

refactor: generic collision handling#59
ripel2 merged 23 commits intomainfrom
33-generic-collision-handler

Conversation

@ripel2
Copy link
Contributor

@ripel2 ripel2 commented Nov 13, 2024

Related to:

I have reworked our collision system to make it as generic as possible.
This implies multiple changes in the way we handle collisions:


No more collision storage. We store collisions as entities and assign them a component. This allows to store any information needed for different types of collisions.


Naming convention: names were all over the place and it was hard to differenciate box collisions and soft body collisions. I have used the following convention: <verb><collisionType>Collisions
For example, DetectABABCollisions or ApplySoftBodyCollisions

Collisions are split into three steps:

  • Detection
  • Application (if applicable, no pun intended)
  • Deletion

Detection only performs the algebra to detect if two objects actually collides and creates a new collision entity according to what happened.
Application updates the colliding components and only happens if it is necessary. For example, with box collisions, it is up to the developer to decide what they want to do with the collision, but with soft body simulations we need to provide a way to update the particle positions.
Deletion simply deletes the collision entities.

Systems should be added in this order as well


I had to merge physics and collisions because of circular patterns happening with the soft body collisions.
Right now there are still two namespaces Physics and Collisions

@ripel2 ripel2 added the enhancement New feature or request label Nov 13, 2024
@ripel2 ripel2 requested a review from a team November 13, 2024 15:54
@ripel2 ripel2 self-assigned this Nov 13, 2024
@ripel2 ripel2 linked an issue Nov 13, 2024 that may be closed by this pull request
@ripel2 ripel2 changed the title refactor: generic collision handler refactor: generic collision handling Nov 13, 2024
@ripel2
Copy link
Contributor Author

ripel2 commented Nov 13, 2024

The new system has been tested on SB-Test-Scene and it works !

@ripel2 ripel2 marked this pull request as ready for review November 13, 2024 16:34
@MasterLaplace MasterLaplace marked this pull request as draft November 13, 2024 19:29
@ripel2 ripel2 requested a review from MasterLaplace November 13, 2024 20:03
@ripel2 ripel2 marked this pull request as ready for review November 13, 2024 20:04
@ripel2 ripel2 merged commit c1194a4 into main Nov 13, 2024
@ripel2 ripel2 deleted the 33-generic-collision-handler branch November 13, 2024 20:08
MasterLaplace pushed a commit that referenced this pull request Dec 6, 2024
Related to:
- #33

I have reworked our collision system to make it as generic as possible.
This implies multiple changes in the way we handle collisions:

---
No more collision storage. We store collisions as entities and assign
them a component. This allows to store any information needed for
different types of collisions.

---
Naming convention: names were all over the place and it was hard to
differenciate box collisions and soft body collisions. I have used the
following convention: `<verb><collisionType>Collisions`
For example, `DetectABABCollisions` or `ApplySoftBodyCollisions`

Collisions are split into three steps:
- Detection
- Application (if applicable, no pun intended)
- Deletion

Detection only performs the algebra to detect if two objects actually
collides and creates a new collision entity according to what happened.
Application updates the colliding components and only happens if it is
necessary. For example, with box collisions, it is up to the developer
to decide what they want to do with the collision, but with soft body
simulations we need to provide a way to update the particle positions.
Deletion simply deletes the collision entities.

Systems should be added in this order as well

---
I had to merge physics and collisions because of circular patterns
happening with the soft body collisions.
Right now there are still two namespaces Physics and Collisions

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generic collision handler

2 participants