Explosions

Jul 24, 2009 at 1:11 PM

Screen Shake: http://www.flatredball.com/frb/forum/viewtopic.php?t=3478

Anyone know about particle explosions and body deformation?

Coordinator
Jul 24, 2009 at 7:19 PM

Farseer Physics does not support particles (simple points). But it can make explosions that push stuff away. I made an example in the advanced samples (demo7 i think) where you can apply wind and explosions.

As for body deformations. It is a rigid physics engine, so any real soft body operations can't be done - but since 2.1 we have 2 different ways of deforming a body:

1. Recalculating polygon geometries

A good example of this would be worms. If a missile hits the ground it deforms. In Farseer Physics you make the terrain (in chunks I might add) and when the missile hits the ground, you create a circle using polygons and subtract it from the terrain polygon. That is easily done using tools in the Vertices class.

2. Using constraints

You can attach several bodies together using joints and springs. They all have a JointError, and when that gets high enough, the joint will break and the bodies fall apart. Imagine a robot where the parts is attached by joints. When a missile hits the body, it will stress the joint. When enough missiles have hit the body, the joint will break and the part will fall off.