Skip to content
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

objects react to collisions (stop movement, explode, remove entity, ...) #38

Open
3 of 5 tasks
co0p opened this issue Oct 30, 2022 · 5 comments
Open
3 of 5 tasks
Assignees

Comments

@co0p
Copy link
Collaborator

co0p commented Oct 30, 2022

currently objects move through each other. There should be a basic collision detection system, that reacts when there was a collision detected

  • collision bounding box component
  • collision system -> AABB detection
  • collision system respects rotation (see SAT)
  • collision demo scene
  • tests

AABB: https://github.com/co0p/foodzy/blob/c9a8a145f264da217b0a9af2f48d588e712c8418/collisionSystem.go#L71

@co0p co0p removed the userstory label Oct 30, 2022
@co0p co0p added this to the gamemode duel 🤺 milestone Jan 7, 2023
jevbelikov added a commit that referenced this issue Jan 13, 2023
jevbelikov added a commit that referenced this issue Jan 13, 2023
jevbelikov added a commit that referenced this issue Jan 13, 2023
jevbelikov added a commit that referenced this issue Jan 13, 2023
@co0p co0p reopened this Jan 23, 2023
@co0p
Copy link
Collaborator Author

co0p commented Jan 23, 2023

@jevbelikov jevbelikov self-assigned this Jan 23, 2023
@co0p
Copy link
Collaborator Author

co0p commented Mar 15, 2023

test cases:

Image

@co0p
Copy link
Collaborator Author

co0p commented Mar 15, 2023

Example on how to do the math with points and rotate matrix... https://math.stackexchange.com/questions/126967/rotating-a-rectangle-via-a-rotation-matrix

co0p added a commit that referenced this issue Mar 17, 2023
co0p added a commit that referenced this issue Mar 17, 2023
@co0p
Copy link
Collaborator Author

co0p commented Mar 17, 2023

co0p added a commit that referenced this issue Mar 17, 2023
co0p added a commit that referenced this issue Mar 19, 2023
co0p added a commit that referenced this issue Mar 23, 2023
@co0p
Copy link
Collaborator Author

co0p commented Mar 23, 2023

Maybe helps:
To get Rx(\theta) in right-handed coordinate system, replace the angle \theta with negative \theta. Then apply the following rules.

cos(-\theta) = cos\theta
sin(-\theta) = -sin\theta

co0p added a commit that referenced this issue Mar 25, 2023
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

No branches or pull requests

2 participants