So basically, I want to be able to reject/allow collision handling dynamically. I already have callbacks and collision selection set up, I just want to know if there is a way to disallow love.physics from handling the collision itself—I want sort of a collision access control list.
Thought of layers, etc. but they only work when you're making the definitions for the shapes, you can't dynamically change a shape's mask (sadly)
Please help!
[love.physics] reject collision from callback
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: [love.physics] reject collision from callback
You can dynamically use shape:setCategory() and shape:setMask(). That's what LovelyBigPlanet uses.
Help us help you: attach a .love.
Re: [love.physics] reject collision from callback
Oh, really? Okay, never mind then! I just assumed from reading the Box2d docs, but whatever, yay!
Re: [love.physics] reject collision from callback
Okay, yes, that works—I was using it wrong before
Is there any way to make a certain shape act like a sensor to one category, and normally in another? I want to detect whether a certain collision has happened with a shape tagged using Shape:setData, and if so, change the mask.
Edit: I may have just answered my own question—create two shapes on the same body.
Is there any way to make a certain shape act like a sensor to one category, and normally in another? I want to detect whether a certain collision has happened with a shape tagged using Shape:setData, and if so, change the mask.
Edit: I may have just answered my own question—create two shapes on the same body.
Who is online
Users browsing this forum: Ahrefs [Bot] and 3 guests