// Copyright (C) 2012 Jérôme Leclercq // This file is part of the "Nazara Engine - Mathematics module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once #ifndef NAZARA_FRUSTUM_HPP #define NAZARA_FRUSTUM_HPP #include #include #include #include #include #include #include template class NzFrustum { public: NzFrustum() = default; template explicit NzFrustum(const NzFrustum& frustum); NzFrustum(const NzFrustum& frustum) = default; ~NzFrustum() = default; NzFrustum& Build(T angle, T ratio, T zNear, T zFar, const NzVector3& eye, const NzVector3& target, const NzVector3& up = NzVector3::Up()); bool Contains(const NzAxisAlignedBox& box) const; bool Contains(const NzCube& cube) const; bool Contains(const NzSphere& sphere) const; bool Contains(const NzVector3& point) const; bool Contains(const NzVector3* points, unsigned int pointCount) const; NzFrustum& Extract(const NzMatrix4& clipMatrix); NzFrustum& Extract(const NzMatrix4& view, const NzMatrix4& projection); const NzVector3& GetCorner(nzCorner corner) const; const NzPlane& GetPlane(nzFrustumPlane plane) const; nzIntersectionSide Intersect(const NzAxisAlignedBox& box) const; nzIntersectionSide Intersect(const NzCube& cube) const; nzIntersectionSide Intersect(const NzSphere& sphere) const; nzIntersectionSide Intersect(const NzVector3* points, unsigned int pointCount) const; NzFrustum& Set(const NzFrustum& frustum); template NzFrustum& Set(const NzFrustum& frustum); NzString ToString() const; private: NzVector3 m_corners[nzCorner_Max+1]; NzPlane m_planes[nzFrustumPlane_Max+1]; }; template std::ostream& operator<<(std::ostream& out, const NzFrustum& frustum); typedef NzFrustum NzFrustumd; typedef NzFrustum NzFrustumf; #include #endif // NAZARA_FRUSTUM_HPP