Calculating kinetic energy of a collision

jargo

12-11-2008 22:04:46

I am making a game where damage done by a projectile is determined by the kinetic energy of the projectile. What would be easiest way to calculate this ? I can't simply use the equation e=1/2m*v^2 because I also need to take account the speed that the target is moving. For example if the target is moving 300 m/s to y+ direction and the projectile is moving 1000 m/s to the y+ direction it should do less damage than if the target would be stationary. I have all ready defined my own contactCallback that gets called when a projectile collides with an object.

dzeligman

24-12-2008 22:16:45

I'm not really sure what you mean exactly by the "kinetic energy of a collision," but I'll write down a few thoughts that may aid you.

If you want to accurate to the laws to the point you're going to have to define the specific of the collision, any outside forces and other stuff.

The collision is probably going to be a simple inelastic collision : http://en.wikipedia.org/wiki/Inelastic_collision or an explosion of sorts. If its an explosion than the KE of the system will probably be converted into heat and sound which would also factor into other variables. If its just inelastic you can probably use some form of conservation of momentum to find the final velocity of the system and the components of energy of the system.

See http://en.wikipedia.org/wiki/Conservation_of_momentum#Conservation_of_linear_momentum for some more detail.