I get not everyone uses or even likes vanilla physics engine but maybe you can decipher this page:
https://love2d.org/wiki/Fixture:setFilterData
I have multiple physics objects on the blue team.
I have multiple physics objects on the red team.
Blue team can not collide with anyone.
Red team can not collide with anyone.
However, both teams can shoot projectiles at each other (physics) and those projectiles can collide with blue or red, but not other projectiles.
What filter do I need?
Help me unpack this wiki page
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Help me unpack this wiki page
Current project:
https://togfox.itch.io/backyard-gridiron-manager
American football manager/sim game - build and manage a roster and win season after season
https://togfox.itch.io/backyard-gridiron-manager
American football manager/sim game - build and manage a roster and win season after season
Re: Help me unpack this wiki page
I don't use the "group" feature, it's never seemed necessary.
"categories" and "mask" are bitmasks. "categories" represents the categories that the fixture is a member of. "mask" represents all the categories that the fixture will collide with.
You probably want a category each for blue team and red team, and a category for projectiles.
Members of both teams should mask out the "blue" and "red" categories (set those bits to 0 in the "mask") so they don't collide with members of either team.
If projectiles shouldn't collide with each other, then mask out the "projectiles" category for them.
If projectiles shouldn't hit the friendly team members, then mask out that team's category.
If projectiles should hit both teams' members, then you don't need to mask out either team's category.
Personally, I made a small module to map string names to each category that I use, and a couple functions to generate the bitmasks from a list of names. So I never have to think about the actual numbers anymore. Let me know if you want me to share it.
"categories" and "mask" are bitmasks. "categories" represents the categories that the fixture is a member of. "mask" represents all the categories that the fixture will collide with.
You probably want a category each for blue team and red team, and a category for projectiles.
Members of both teams should mask out the "blue" and "red" categories (set those bits to 0 in the "mask") so they don't collide with members of either team.
This isn't 100% clear to me. Is there friendly fire? Should projectiles only hit the opposing team, or should they collide with a member of either team?
If projectiles shouldn't collide with each other, then mask out the "projectiles" category for them.
If projectiles shouldn't hit the friendly team members, then mask out that team's category.
If projectiles should hit both teams' members, then you don't need to mask out either team's category.
Personally, I made a small module to map string names to each category that I use, and a couple functions to generate the bitmasks from a list of names. So I never have to think about the actual numbers anymore. Let me know if you want me to share it.
Re: Help me unpack this wiki page
Any projectile can hit any player/team so - yes - friendly fire is a thing.
I guess, in hindsight, I should have said players can only hit projectiles and projectiles can only hit players.
I guess, in hindsight, I should have said players can only hit projectiles and projectiles can only hit players.
Current project:
https://togfox.itch.io/backyard-gridiron-manager
American football manager/sim game - build and manage a roster and win season after season
https://togfox.itch.io/backyard-gridiron-manager
American football manager/sim game - build and manage a roster and win season after season
Re: Help me unpack this wiki page
OK, in that case you only need two categories: one for players and one for projectiles.
Players mask out players, and projectiles mask out projectiles.
Players mask out players, and projectiles mask out projectiles.
Who is online
Users browsing this forum: No registered users and 94 guests