How can one check to see if light from a lamp is illuminating an object?
.
This is obviously already being calculated by the render engine, so it would make sense that you could just use that information to return a true/false
.
Main goal: I need to check at the end of each turn if a player’s game piece is being illuminated by a lamp source or if it is occluded by an object (a person entirely behind a wall would not be illuminated, but a person with an arm sticking out from behind the wall would be marked as illuminated (it needs to be very accurate)).
.
The source would be singular, so a raycast of sorts might work, but aside from casting at an object’s origin, I wouldn’t know how to go about checking for any extensions of an object that might be exposed.
.
Ideas?
Vector3.Distance(light to obj) is a quick method