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

Use a circle for the ball in Breakout #4324

Closed
alice-i-cecile opened this issue Mar 24, 2022 · 10 comments
Closed

Use a circle for the ball in Breakout #4324

alice-i-cecile opened this issue Mar 24, 2022 · 10 comments
Labels
C-Examples An addition or correction to our examples D-Trivial Nice and easy! A great choice to get started with Bevy

Comments

@alice-i-cecile
Copy link
Member

Once #3730 is merged, we should represent the ball as a circle, rather than a square. We can probably stick with the AABB collision though for simplicity.

@alice-i-cecile alice-i-cecile added C-Examples An addition or correction to our examples S-Blocked This cannot move forward until something else changes labels Mar 24, 2022
@rparrett
Copy link
Contributor

I have a feeling that in practice, not doing proper circle-aabb collision would end up looking pretty janky, but I'd personally love to see that if it doesn't complicate the example too much.

@mockersf
Copy link
Member

as a side note, this could already be done by using a round image, like https://github.com/bevyengine/bevy/blob/main/assets/branding/icon.png

@alice-i-cecile alice-i-cecile added D-Trivial Nice and easy! A great choice to get started with Bevy and removed S-Blocked This cannot move forward until something else changes labels May 5, 2022
@alice-i-cecile
Copy link
Member Author

#3730 is merged so this is now quite easy :)

@tkgalk
Copy link
Contributor

tkgalk commented Aug 11, 2022

I made a PR pretty much exactly the same as the #4682, if there is no answer from the creator of that PR, I can submit mine if you wish.

@alice-i-cecile
Copy link
Member Author

Yes please @galkowskit :) Just link to the other PR and we'll credit you both.

@tkgalk
Copy link
Contributor

tkgalk commented Aug 11, 2022

#5657

@rparrett
Copy link
Contributor

So the obvious collision "corner case" is this sort of thing:

corner-case-heh.mov

We could

  1. Have a circle with slightly wrong collisions
  2. Have a square with better collisions
  3. Fix the collision code

I have a slight preference for 2 but it seems like fixing the collision code would be sort of involved, so I suppose I don't really mind 1.

@tkgalk
Copy link
Contributor

tkgalk commented Aug 11, 2022

I think it also touches the physics issue. There is a very rudimentary code for reflections.

@bors bors bot closed this as completed in f9104b7 Aug 16, 2022
maccesch pushed a commit to Synphonyte/bevy that referenced this issue Sep 28, 2022
# Objective

- Replace the square with a circle in the breakout example.
- Fixes bevyengine#4324, adopted from bevyengine#4682 by @shaderduck.

## Solution
- Uses the Mesh2D APIs to draw a circle. The collision still uses the AABB algorithm, but it seems to be working fine, and I haven't seen any odd looking cases.
james7132 pushed a commit to james7132/bevy that referenced this issue Oct 28, 2022
# Objective

- Replace the square with a circle in the breakout example.
- Fixes bevyengine#4324, adopted from bevyengine#4682 by @shaderduck.

## Solution
- Uses the Mesh2D APIs to draw a circle. The collision still uses the AABB algorithm, but it seems to be working fine, and I haven't seen any odd looking cases.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this issue Feb 1, 2023
# Objective

- Replace the square with a circle in the breakout example.
- Fixes bevyengine#4324, adopted from bevyengine#4682 by @shaderduck.

## Solution
- Uses the Mesh2D APIs to draw a circle. The collision still uses the AABB algorithm, but it seems to be working fine, and I haven't seen any odd looking cases.
@AlexBrodbelt
Copy link

Hi, I'm trying to make a (modified) billiards game and need to detect to collision between balls. I was wondering if there already exists an implementation within bevy or whether I should make my own (and if its good/suitable enough I can contribute it back to bevy?). I've never contributed before so I'm not sure how this works. Thank you!

@mockersf
Copy link
Member

Bevy currently only has Axis Aligned Bounding Box for collisions, which probably wouldn't work very well for billiard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Examples An addition or correction to our examples D-Trivial Nice and easy! A great choice to get started with Bevy
Projects
None yet
5 participants