I want to determine if a mesh is lit by the directional light on my scene in editor to automatically disable its "dynamic shadow casting" property (let's say I have one light source in my scene which is this directional light).
The mesh is a static object: it can't move and it's not animated. It has a bounding box and a bounding sphere. All I need to do is to provide a plausible (not 100% accurate) answer to the following question: "is my static mesh fully occluded by some other static meshes?". I am not going to do that in real time, it's just an editor check, but my scene has several thousand static meshes, so it shouldn't be dead slow.
I'm afraid that the only way to do that is by performing a ray (or line) tracing in the direction of my light source. I can just trace the vertices of my bounding box, but the mesh can be partially occluded (e.g. vertices are, the centre of the bounding box is not) so my guess is that I need to trace a projection of the bounding box in the direction of my light source but I don't know how to calculate things like that and my idea may not be correct. :(