Conversation
Should I provide an example for this feature? Or simple enough? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I used
CollidingEntities
because the suggestedCollision
could be confusing (and already used in Bevy, but not in prelude). Is this okay name?
Yeah Collision
wouldn't be good. Collisions
is already a little bit better. I kind of like CollidingEntities
though we could go for that.
We may also consider: CollisionSet
or CollidedEntities
, stuff like that.
No need to bikeshed too much though, if we find a better name later we can change it without making a breaking change (by making the old name an alias)
- Should we provide
Deref
forCollidingEntities
?
No. That would expose internal details that we couldn't change without breaking the API.
I would like to make this new way for observing collisions the "main" way. As I think it is simpler and more ergonomic in most cases. Therefore I would suggest updating the existing But if you don't feel like doing it in this PR, it's fine. We can do it later. |
I will do it in this PR. |
I somehow misread your first message in the issue and thought that you proposed |
I applied your suggestions, but discovered the issue with the event example. When I remove an entity, it doesn't emit
|
I think I would lean toward option 1. What do you think? |
Yes, I would expect |
On second thought I should have a list of colliding entities to emit this |
I have to look into it. Somehow, I am surprised, that it isn't already the case, that kind of sounds like a bug to me. I'll investigate that, and come back to you. |
I discovered another case when |
Until the mentioned issue fixed upstream, I think I can start working on option 2:
When the fix arrives, we can just delete the removal detection. |
Co-authored-by: King-Aardvark <18710516+King-Aardvark@users.noreply.github.com>
Implemented. I also rebased to the latest master and improved tests description. |
Thanks! I'll try to look at it this week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just change iter
to:
pub fn iter(&self) -> impl Iterator<Item = Entity> {
self.0.iter().copied()
}
Done! I also had to add anonymous lifetime. |
Closes #207.
I added a component that automatically filled with colliding object entities.
Things to discuss:
CollidingEntities
because the suggestedCollision
could be confusing (and already used in Bevy, but not in prelude). Is this okay name?Deref
forCollidingEntities
?