
.. _program_listing_file_Src_GraphicsEngineVulkan_scene_Frustum.ixx:

Program Listing for File Frustum.ixx
====================================

|exhale_lsh| :ref:`Return to documentation for file <file_Src_GraphicsEngineVulkan_scene_Frustum.ixx>` (``Src/GraphicsEngineVulkan/scene/Frustum.ixx``)

.. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS

.. code-block:: cpp

   module;
   #include <array>
   #include <glm/glm.hpp>
   
   export module kataglyphis.vulkan.frustum;
   
   export namespace Kataglyphis {
   
   struct AABB
   {
       glm::vec3 min{ 0.0F };
       glm::vec3 max{ 0.0F };
   
       [[nodiscard]] bool isValid() const { return min.x <= max.x && min.y <= max.y && min.z <= max.z; }
   };
   
   using FrustumPlanes = std::array<glm::vec4, 6>;
   
   FrustumPlanes extractFrustumPlanes(const glm::mat4 &viewProjection);
   
   bool isVisible(const FrustumPlanes &planes, const AABB &boxWorldSpace);
   
   bool isVisibleAsShadowCaster(const FrustumPlanes &planes, const AABB &boxWorldSpace);
   
   AABB transformAABB(const glm::mat4 &model, const AABB &boxObjectSpace);
   
   }// namespace Kataglyphis
