2020-04-13 00:36:53 +02:00
|
|
|
#pragma once
|
2020-04-13 10:01:45 +02:00
|
|
|
|
2020-05-30 15:55:23 +02:00
|
|
|
class Frustum
|
|
|
|
{
|
2020-04-13 10:01:45 +02:00
|
|
|
public:
|
|
|
|
|
|
|
|
Frustum() = default;
|
|
|
|
|
2020-05-30 15:55:23 +02:00
|
|
|
void Update(const Matrix& view, const Matrix& projection);
|
|
|
|
bool PointInFrustum(const Vector3& position) const;
|
|
|
|
bool SphereInFrustum(const Vector3& position, float radius) const;
|
|
|
|
bool AABBInFrustum(const Vector3& min, const Vector3& max) const;
|
2020-04-13 10:01:45 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
void NormalizePlane(int32_t side);
|
|
|
|
std::array<std::array<float, 4>, 6> m_frustum = {};
|
2020-04-13 00:36:53 +02:00
|
|
|
|
|
|
|
};
|