TombEngine/TR5Main/Renderer/Frustum.h

19 lines
413 B
C
Raw Normal View History

2020-04-13 00:36:53 +02:00
#pragma once
2020-04-13 10:01:45 +02:00
class Frustum
{
2020-04-13 10:01:45 +02:00
public:
Frustum() = default;
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
};