Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm looking for a good way to simulate damage, for example a weapon firing at a ship it would calculate the damage depending on layer type, weapon type, angle and similar what i need is a way to to represent the damage to a certain layer. I'm thinking of using matrices for keeping track of damage and also the appearance of the model.

What the problem is for flat surfaces its not a problem but for curved surfaces calculating the angle, at least no way that i know of.

For example its a curved hull with 3 armor layers, so we have 4 matrices 3 for the integrity of the armor and a 4th for the height map there is also a density variable(increasing the armor matrix size and then assigning more values in the heightmap/location map to the coresponding layer surface.

Is there a better way to do this?

share|improve this question
    
I'm sorry, I do not completely understand the question. Is your problem calculating the damage or showing the damage? –  drxzcl Apr 8 '11 at 8:15
    
If your mesh is made of polygons, can't you just approximate the normal using the cross product of two edges in the polygon hit? Or are you doing something clever? –  Lewis Wakeford Jul 3 '13 at 12:27

1 Answer 1

If you have the equation of the curve in question - or even just an approximation - then you can work out the tangent of the curve at the point where the projectile contacts it. You can then treat that tangent as if it was a flat surface that has been hit and work out the angle of incidence accordingly.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.