[ODE] Explosions

GARY VANSICKLE g.r.vansickle at worldnet.att.net
Fri Jul 9 20:06:15 MST 2004


> Hi,
> 
> I need some help implementing explosions in my game.
> I've tried searching the archives, but most threads seem to 
> be about unwanted explosions :)
> 
> An example: Say I have a big cube composed of smaller cubes 
> (5 x 5 x 5 matrix) in my scene. I want the cube in the bottom 
> center to explode and create a shockwave that hurls the other 
> cubes outwards. Any easy ways to achieve this? I also want 
> the shockwave to have an outer limit/radius. That is, 
> cubes/objects which are outside the blast radius shouldn't be 
> affected (unless of course they are hit by other cubes).
> 
> 
> Thanks in advance!

For this particular case, probably the best way to do this would be to apply
a face-centered impulse to each cube adjacent to the exploding one.  ODE
doesn't support impulses directly (my patch was rejected ;-( ), so you'll
have to apply a force during one step that's equal to:

Force = Impulse/DeltaT

Now, how you figure out what the value of Impulse should be is probably best
left to trial and error, unless you know a way to calculate it from whatever
the explosive is.

This method inherently eliminates any issues with limiting the blast radius;
the shockwave will only propagate via object collisions.

-- 
Gary R. Van Sickle
 




More information about the ODE mailing list