zeus/include/zeus/CFrustum.hpp
Lioncash 81f9b4a4ee General: Mark functions as nodiscard where applicable
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.
2020-03-04 03:07:54 -05:00

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