blob: 25dcc18931d9452438ef89679f7cc534907c4ac6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#pragma once
#include <array>
#include <glm/mat4x4.hpp>
class Frustum {
public:
Frustum(const glm::mat4 & view, const glm::mat4 & projection);
[[nodiscard]] auto &
getFrustumPlanes() const
{
return planes;
}
[[nodiscard]] auto &
getViewProjection() const
{
return viewProjection;
}
void updateView(const glm::mat4 & view);
protected:
static constexpr size_t FACES = 6;
void updateCache();
glm::mat4 view, projection;
glm::mat4 viewProjection, inverseViewProjection;
std::array<glm::vec4, FACES> planes;
};
|