How to create collision matching a 3D frustum for FPS game?

I want to detect if I see anything that is visible in the frustum in a 3D perspective, e.g. to detect if player that is able to rotate this frustum around (like FPS) is looking at an interactive object.

My first attempt is to create a simple collision object component with box type, but obviously it’s not perfect:

image

Adding more boxes could help me in one direction, but there are areas where I detect objects that are really not visible of course:

image

Is there a better way to define such collision object shape?
Or approach other than collision object? Of course, I want to have an information is something is in the frustum in a Lua script responsible for some kind of logic still.
Or maybe is there a Feature Request to add such collision shape (Frustum/Pyramid) as a primitive one?

1 Like

Maybe checking the distance and angle between the direction of the camera and the interactive object position without any physics is cheaper and easier?

3 Likes

Or, use a single box, and then discard items that are outside of the frustum (i.e create a math function for it)

3 Likes

Any examples of this?