Hymn to Beauty
C++ 3D Engine
Frustum.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <glm/glm.hpp>
4
5namespace Video {
6class AxisAlignedBoundingBox;
7class Sphere;
8
10
13class Frustum {
14 public:
16
19 explicit Frustum(const glm::mat4& matrix);
20
22
26 bool Intersects(const AxisAlignedBoundingBox& aabb) const;
27
29
33 bool Intersects(const Sphere& sphere) const;
34
35 private:
36 glm::vec4 planes[6];
37
38 // The distance returned is the signed distance in normal vector units.
39 // To ensure the "true" distance the plane equation has to be normalized.
40 static float DistanceToPoint(const glm::vec4& plane, const glm::vec3& point);
41};
42} // namespace Video
An axis-aligned bounding box.
Definition: AxisAlignedBoundingBox.hpp:12
A viewing frustum.
Definition: Frustum.hpp:13
bool Intersects(const AxisAlignedBoundingBox &aabb) const
Check intersection between frustum and an axis-aligned bounding box.
Definition: Frustum.cpp:53
Frustum(const glm::mat4 &matrix)
Create new frustum.
Definition: Frustum.cpp:9
A sphere.
Definition: Sphere.hpp:12
Definition: Editor.hpp:18