[SOLVED]
to make fixtures that do generate collisions (and thus affect anything with which they collide), but can still share space, use a sensor fixture.
http://love2d.org/wiki/Fixture:setSensor
------------------------------------------------------------
------------------------------------------------------------
Ignoring collisions in love.physics is easy, but I'd like to figure out how to make objects that "quasi-collide" with desired categories.
For instance, imagine a bullet fired from a high powered sniper rifle. It might pass through several walls before finally becoming lodged in a particularly dense concrete wall, or shattering when it hits the surface of water or the ground.
Imagine likewise a pool of water. You can share space with it (be "inside" of it), but it still affects you. It slows down your movement and applies a constant upward force proportional to your bouyancy.
Consider a pool of acid. It acts like water, but constantly damages anything unfortunate enough to come in contact with it.
These things all share a common thread. Just like regular fixtures with filters and masks, they do affect anything (except for ignored categories) that touch, or are touched by, them -- they generate collisions accordingly. Unlike regular fixtures, however, they can share a space with anything they collide with.
Is there an established way to make this work? I'm going to run some tests to try and solve this on my own. Firstly, I want to see what happens if you create a fixture and body without attaching a shape.
Thanks for your help, LÖVErs!
Bullets that Penetrate -- damage objects but don't collide
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 19
- Joined: Sat Sep 06, 2014 8:50 pm
Bullets that Penetrate -- damage objects but don't collide
Last edited by Snackrilege on Tue Sep 09, 2014 8:29 pm, edited 2 times in total.
Re: Bullets that Penetrate -- damage objects but don't colli
You're looking for Sensor Fixtures:
http://love2d.org/wiki/Fixture:setSensor
http://love2d.org/wiki/Fixture:setSensor
-
- Prole
- Posts: 19
- Joined: Sat Sep 06, 2014 8:50 pm
Re: Bullets that Penetrate -- damage objects but don't colli
Ah, yeah, that's it precisely. Thanks, Plu. Gosh, I'm batting a thousand with these long questions that can be answered with one or two words.
Thanks again. Extremely helpful.
Thanks again. Extremely helpful.
Re: Bullets that Penetrate -- damage objects but don't colli
No worries, that's always how it begins ![Smile :)](./images/smilies/ms-smile.png)
Soon you'll be knee-deep in a project and you'll have to do everything yourself, so enjoy the available solutions while they last!
![Smile :)](./images/smilies/ms-smile.png)
Soon you'll be knee-deep in a project and you'll have to do everything yourself, so enjoy the available solutions while they last!
Who is online
Users browsing this forum: Bing [Bot], Google [Bot], Semrush [Bot] and 3 guests