Armor thickness per impact point

Hello!

I am looking for an advice on how to implement tank armor thickness per impact point.

Basically I’d like to have low-poly body responsible for projectile interaction.

Each face of a body has armor thickness assigned to it. When a projectile hits a face, I’ll calculate penetration based on impact angle and armor thickness.

I came up with two approaches, but I couldn’t complete any of them.

  1. Hit Result - Face Index. The idea here is to have a TMap<int32, float> where each face has thickness assigned to it. The problem is map initialization. I’ll probably need to write custom FBX parser to get list of triangles and color assigned to them. Is there an easier way to assign color/float to a face?

  2. Find Collision UV

The problem here is that I couldn’t find how to get pixel color using these UVs. Also it looks like a costly operation if it has to be enabled on project level.

(I’m doing extra line trace from slightly above collision point to slightly below it, because original hit result doesn’t return face index or UVs)

Thank you!

I think I got first one working, but any suggestions are still welcome :slight_smile:

Model has several materials which represent armor thickness.

I am getting material by face index, then using section index to lookup thickness in array [100, 150, 200, 250].

Mesh has complex collision as simple enabled.