2018-10-06 20:39:40 -07:00
|
|
|
#pragma once
|
2015-05-06 00:20:44 -07:00
|
|
|
|
2019-09-03 11:17:30 -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 {
|
2019-09-01 00:38:45 -07:00
|
|
|
class CAABox;
|
|
|
|
class CMatrix4f;
|
|
|
|
class CProjection;
|
|
|
|
class CSphere;
|
|
|
|
|
2018-12-07 17:16:50 -08:00
|
|
|
class CFrustum {
|
2019-09-03 11:17:30 -07:00
|
|
|
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);
|
2020-02-29 01:33:29 -08:00
|
|
|
[[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
|