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

Add setCollisionMask and getCollisionMask to Shape's API #2090

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions testing/tests/physics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -447,15 +447,15 @@ love.test.physics.Shape = function(test)
test:assertEquals(nil, yn2, 'check ray 2 y')

-- check filtering
test:assertEquals(nil, shape2:getCollisionMask(), 'check no mask')
shape2:setCollisionMask(1, 2, 3)
test:assertEquals(3, #{shape2:getCollisionMask()}, 'check set mask')
test:assertEquals(nil, shape2:getMask(), 'check no mask')
shape2:setMask(1, 2, 3)
test:assertEquals(3, #{shape2:getMask()}, 'check set mask')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test:assertEquals(0, shape2:getGroupIndex(), 'check no index')
shape2:setGroupIndex(-1)
test:assertEquals(-1, shape2:getGroupIndex(), 'check set index')
local cat, mask, group = shape2:getFilterData()
test:assertEquals(1, cat, 'check filter cat')
test:assertEquals(7, mask, 'check filter mask')
test:assertEquals(65528, mask, 'check filter mask')
test:assertEquals(-1, group, 'check filter group')

-- check destroyed
Expand Down