Quick Explosions

how to implement that class in main file??
i think we could use a number of raycasts

this would give us the points to apply to force to, and the distance to them, and rule out any objects greater than that distance away.
it would also allow us to do an overall calculation of how many of the explosion vectors are being stunted and by how much. which would allow us to strengthen the rest of the vectors to generate the effect that when a bomb is surrounded on other sides it explodes stronger in the direction thats open.

i could write this in a way that i think would still qualify as a "Quick Explosion" with variable raycasts, distance, and strength.
i would recommend around 80 raycasts for a fairly accurate explosion, which would probably slow down if you were to have 50 or more explosions happening at the same time, in which case you would probably want to reduce the raycasts.

i currently don't have a use for this, so if you like the idea you have to let me know.
Zombie topic ^^..

But yeah, that would be useful nonetheless, I never saw a feasible alternative to 'super-naive-explosions' so I never bothered to change my method.
i made a class called explodeworld(from above code) now in main file i made an instance(bomb) to that class
and in update() i am calling bomb.explodeworld(b2vec2,radius,stength).
but its not working i dont want theory i want to implement this 🙁
see this
any hints??
Could someone please post a demo file?
For an accurate tail off I don't think you need to square root anything. Instead the impulse should be proportional to one over the distance squared. This should actually save you a square root because you probably have to use Pythagoras to find the distance. If I decide to implement rotation, I'll post the solution once I have it. 80 raycasts per object could be too expensive seeing as I'm developing for smart phones and have several objects exploding at once. Struggling to think of a better way.
I actually just implemented bombs in my game (which is still in pre-alpha) a couple of weeks ago, with blast radius and containment. But yeah, multiple ray casts takes a toll when you're querying a lot of fixtures (around 30 or 40?), and of course it makes it worse when you're doing multiple ray casts multiple times (like 5 bombs going off in the vicinity of 20 other bodies).

Original thread: https://box2d.org/forum/viewtopic.php?t=3135