[ODE] Simulate gun shot on body

david@csworkbench.com david at csworkbench.com
Fri Mar 21 15:37:01 2003


Another idea you might try for fun:  create invisible spheres (geom only)
at the points of impact.  The size of the sphere determines the force of
the explosion.  You would probably want to cache the size and position of
the spheres during your first run through CD, add them, then just collide
those spheres separately to keep from messing with the geometry system
mid-collision detection.  But this way you could easily scale from a BB to
bazooka blast with the same system, you get splash damage when stuff is
close enough and all that good stuff.  Lower the center of the sphere to
make stuff fly farther :)  Shrink the spheres every timestep until they
are small, then destroy them.  You may have to give the explosion balls a
separate erp/cfm than the rest of the simulation to get it just right. 
Just a thought.

David

> instead of deleting the bullet right away, you could either just stop
> redrawing it or delete it a few steps after the hit when the impulse has
>  been transferred.
>
> At 09:49 AM 3/21/2003 +0200, Ivan Bolcina wrote:
>>Hi. I have some box geom in space. This geom is hit by bullet. When
>> bullet  hits it, bullet gets deleted. In same time, I want body to
>> react to this  bullet. I assume I need to put some impulse to body. How
>> to do it?