Add setCollisionMask and getCollisionMask to Shape's API#2090
Open
Bruception wants to merge 2 commits into
Open
Add setCollisionMask and getCollisionMask to Shape's API#2090Bruception wants to merge 2 commits into
setCollisionMask and getCollisionMask to Shape's API#2090Bruception wants to merge 2 commits into
Conversation
Bruception
commented
Aug 9, 2024
| @@ -161,8 +161,10 @@ class Shape : public love::physics::Shape | |||
|
|
|||
| int setCategory(lua_State *L); | |||
| int setMask(lua_State *L); | |||
Author
There was a problem hiding this comment.
Unclear to me if we want to maintain this API, or prefer to deprecate.
Bruception
commented
Aug 9, 2024
Comment on lines
+450
to
+452
| test:assertEquals(nil, shape2:getMask(), 'check no mask') | ||
| shape2:setMask(1, 2, 3) | ||
| test:assertEquals(3, #{shape2:getMask()}, 'check set mask') |
Author
There was a problem hiding this comment.
Reverting after reading:
https://github.com/love2d/love/tree/main/testing#l%C3%B6vetest
Author
|
@slime73, is there anything else I should do to get this across the line? |
Member
|
I'm wondering about usability - if someone wants an object to collide with everything or nearly everything, they'd need to specify around 16 parameters with the new API whereas with the old one it'd be much less. |
|
Previous behavior still works if I'm correct so you can still use it. The real question to me is will we keep the two implementations ? I would prefer to have functions:
|
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.
Implements the suggestion in: #2072