How can I get all actors in a camera's view frustum?

eXi: Yes, just wanted to clarify why it isn’t needed to use it just as a frustrum-culling, and use it to for actual impelemtation.

undercover: You are about right… BUT, if implemented correctly, you won’t have that problem.

Implement the algorithm by:

  1. Find your upper left of your selection in screenspace (pixels)
  2. Find lower right of your selection in screenspace (pixels)
  3. Use canvas to deproject your upper left hud location, then you get a world location on your near plane, and the direction to the backplane that the pixel maps to. This will adjusted for your aspect ratio and FoV
  4. Trace from this location in the direction until you hit world geometry. This will be your upper left world location where you start using your box
  5. Do step 3 and 4 with your lower right location of your box.
  6. Now you have the upper left, and lower right location in world locations.
  7. Now you can get all units between these points by doing a boxtrace without beeing afraid that it will be distorted by the perspective.

Ofcourse, this is just a optimized version for a smaller area than how you have done it. You can still do it the way you have done.

I hope this explanation was somewhat manageable to follow now that I had more time to write, rather than write while compiling at office :wink: