Elevate Engine
1
Loading...
Searching...
No Matches
Frustum.h
Go to the documentation of this file.
1
#include "glm/glm.hpp"
2
3
namespace
Elevate
4
{
5
class
Camera;
6
7
struct
Plane
8
{
9
glm::vec3
normal
= { 0.f, 1.f, 0.f };
10
float
distance
= 0.0f;
11
12
void
Set
(
const
glm::vec3&
normal
,
const
glm::vec3& point)
13
{
14
this->normal = glm::normalize(
normal
);
15
this->distance = -glm::dot(this->normal, point);
16
}
17
18
float
DistanceToPoint
(
const
glm::vec3& point)
const
19
{
20
return
glm::dot(
normal
, point) +
distance
;
21
}
22
};
23
24
enum
FrustumPlane
25
{
26
NEAR_PLANE
= 0,
27
FAR_PLANE
,
28
TOP_PLANE
,
29
BOTTOM_PLANE
,
30
RIGHT_PLANE
,
31
LEFT_PLANE
32
};
33
34
struct
Frustum
35
{
36
Frustum
() =
default
;
37
Frustum
(
Camera
& camera);
38
39
Plane
planes
[6];
40
};
41
}
42
Elevate::Camera
Definition
Camera.h:14
Elevate
Definition
AudioDistanceProbe.h:9
Elevate::FrustumPlane
FrustumPlane
Definition
Frustum.h:25
Elevate::RIGHT_PLANE
@ RIGHT_PLANE
Definition
Frustum.h:30
Elevate::TOP_PLANE
@ TOP_PLANE
Definition
Frustum.h:28
Elevate::FAR_PLANE
@ FAR_PLANE
Definition
Frustum.h:27
Elevate::BOTTOM_PLANE
@ BOTTOM_PLANE
Definition
Frustum.h:29
Elevate::NEAR_PLANE
@ NEAR_PLANE
Definition
Frustum.h:26
Elevate::LEFT_PLANE
@ LEFT_PLANE
Definition
Frustum.h:31
Elevate::Frustum
Definition
Frustum.h:35
Elevate::Frustum::Frustum
Frustum()=default
Elevate::Frustum::planes
Plane planes[6]
Definition
Frustum.h:39
Elevate::Plane
Definition
Frustum.h:8
Elevate::Plane::distance
float distance
Definition
Frustum.h:10
Elevate::Plane::DistanceToPoint
float DistanceToPoint(const glm::vec3 &point) const
Definition
Frustum.h:18
Elevate::Plane::Set
void Set(const glm::vec3 &normal, const glm::vec3 &point)
Definition
Frustum.h:12
Elevate::Plane::normal
glm::vec3 normal
Definition
Frustum.h:9
ElevateEngine
src
ElevateEngine
Renderer
Camera
Frustum.h
Generated by
1.9.8