#ifndef FRUSTUM_HPP_
#define FRUSTUM_HPP_

#include <Plane/Plane.hpp>

/**
 * @brief Describes a frustum.
 */
struct Frustum
{
    Plane farFace;

    Plane topFace;
    Plane bottomFace;

    Plane rightFace;
    Plane leftFace;

    /**
     * @brief Return true if the specified bounding box is within this frustum.
     * 
     * @param bb The bounding box.
     */
    inline bool containsBox(const BoundingBox<double> &bb) const
    {
        return topFace.isBoxInFront(bb) && bottomFace.isBoxInFront(bb)
            && rightFace.isBoxInFront(bb) && leftFace.isBoxInFront(bb)
            && farFace.isBoxInFront(bb);
    }
};

#endif