Simulating explosions
We know you're thinking, "What good is all this physics knowledge if we can't blow stuff up?", and we've got you covered!
The physical world implementation provides a simple function for simulating explosions in the world, with a wide range of parameters to allow customization of the blast area.
To demonstrate, we'll create an explosion with a maximum radius of 100:
pe_explosion explosion; explosion.rmax = 100; gEnv->pPhysicalWorld->SimulateExplosion(&explosion);
Note
The SimulateExplosion
function will merely simulate an explosion and generate a force that pushes entities away, it will not create any particle effects.