mirror of
https://github.com/AxioDL/zeus.git
synced 2025-06-30 18:33:38 +00:00
Given this aims to be a general purpose math library for use in various other libraries applications for axiodl, we can annotate functions that return by value or reference with [[nodiscard]] where it's very obvious that not making use of the return value is a bug. This allows the compiler to diagnose and emit warnings for these API misuses at compile-time, preventing silent bugs from occurring. Any cases where not using the return value is desirable may still be casted to void in order to silence warnings.
24 lines
607 B
C++
24 lines
607 B
C++
#pragma once
|
|
|
|
#include <array>
|
|
#include "zeus/CPlane.hpp"
|
|
|
|
namespace zeus {
|
|
class CAABox;
|
|
class CMatrix4f;
|
|
class CProjection;
|
|
class CSphere;
|
|
|
|
class CFrustum {
|
|
std::array<CPlane, 6> planes;
|
|
bool valid = false;
|
|
|
|
public:
|
|
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;
|
|
};
|
|
} // namespace zeus
|