zeus/include/zeus/CFrustum.hpp

24 lines
607 B
C++
Raw Normal View History

2018-10-06 20:39:40 -07:00
#pragma once
2015-05-06 00:20:44 -07:00
#include <array>
2016-03-04 15:03:26 -08:00
#include "zeus/CPlane.hpp"
2015-05-06 00:20:44 -07:00
2018-12-07 17:16:50 -08:00
namespace zeus {
class CAABox;
class CMatrix4f;
class CProjection;
class CSphere;
2018-12-07 17:16:50 -08:00
class CFrustum {
std::array<CPlane, 6> planes;
2018-12-07 17:16:50 -08:00
bool valid = false;
2016-07-08 11:42:42 -07:00
2015-05-06 00:20:44 -07:00
public:
2018-12-07 17:16:50 -08:00
void updatePlanes(const CMatrix4f& viewMtx, const CMatrix4f& projection);
void updatePlanes(const CTransform& viewPointMtx, const CProjection& projection);
[[nodiscard]] bool aabbFrustumTest(const CAABox& aabb) const;
[[nodiscard]] bool sphereFrustumTest(const CSphere& sphere) const;
[[nodiscard]] bool pointFrustumTest(const CVector3f& point) const;
2015-05-06 00:20:44 -07:00
};
2018-12-07 21:23:50 -08:00
} // namespace zeus