I thought it might be good idea to add something like b2Particle which would be affected by other bodies, but itself would not affect others and would be as small as 1 px. It could be used to simulate sand, water and stuff like that. What do you think about this? Is it possible to easily add this feature to the Box2D engine? I'm not much of a math genius 😉
Request: Particle
Bugs, Requests, and FeedbackIt's easy to add, but Box2D would fold under the performance pressure. Fluids usually require a different regime of calculation, there is some research into this in another thread.
Why would it fold under the performance pressure? Would it be slower than creating circles?
JBox2d has a point shape, which I added because I thought it would probably be better for things like fluids and all that. It's almost exactly the same as a circle shape, except the code is manually trimmed to impose radius=0.
Works fine, but I've not had much use for it, and I never wrote point-vs-edge collision algorithms. The problem with points is that if you make a lot of them, they tend to pile up on each other (zero extent, so they don't collide with each other) and this eventually chokes up the broadphase because it makes too many pairs. Even with an algorithm like SPH, which should theoretically keep objects apart, I don't like the possibility of too many things overlapping each other and blowing up the program, so I tend to stick with circles (which at least have some rigid qualities, and won't pack together too tightly).
But it's pretty easy to implement if you really need it, you can get to the source from http://www.jbox2d.org if you follow the Sourceforge link. I'd try small circles first, though, it will save a bit of trouble.
Works fine, but I've not had much use for it, and I never wrote point-vs-edge collision algorithms. The problem with points is that if you make a lot of them, they tend to pile up on each other (zero extent, so they don't collide with each other) and this eventually chokes up the broadphase because it makes too many pairs. Even with an algorithm like SPH, which should theoretically keep objects apart, I don't like the possibility of too many things overlapping each other and blowing up the program, so I tend to stick with circles (which at least have some rigid qualities, and won't pack together too tightly).
But it's pretty easy to implement if you really need it, you can get to the source from http://www.jbox2d.org if you follow the Sourceforge link. I'd try small circles first, though, it will save a bit of trouble.
Original thread: https://box2d.org/forum/viewtopic.php?t=2777