summaryrefslogtreecommitdiffstats
path: root/src/Frustum.hpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-10-09 18:39:48 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-01-13 03:39:32 +0100
commita81bcb1942ddad5989115061338e72211443e633 (patch)
treecb1cc6feadb7dfb49f96cbc9b2a4f2bfb9ad8488 /src/Frustum.hpp
parent2017-10-07 (diff)
downloadAltCraft-a81bcb1942ddad5989115061338e72211443e633.tar
AltCraft-a81bcb1942ddad5989115061338e72211443e633.tar.gz
AltCraft-a81bcb1942ddad5989115061338e72211443e633.tar.bz2
AltCraft-a81bcb1942ddad5989115061338e72211443e633.tar.lz
AltCraft-a81bcb1942ddad5989115061338e72211443e633.tar.xz
AltCraft-a81bcb1942ddad5989115061338e72211443e633.tar.zst
AltCraft-a81bcb1942ddad5989115061338e72211443e633.zip
Diffstat (limited to 'src/Frustum.hpp')
-rw-r--r--src/Frustum.hpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/Frustum.hpp b/src/Frustum.hpp
new file mode 100644
index 0000000..4817cd4
--- /dev/null
+++ b/src/Frustum.hpp
@@ -0,0 +1,35 @@
+#pragma once
+
+#include <glm/glm.hpp>
+#include "Vector.hpp"
+
+class Frustum {
+ enum FrustumSide {
+ RIGHT = 0,
+ LEFT,
+ BOTTOM,
+ TOP,
+ BACK,
+ FRONT,
+ };
+ enum PlaneData {
+ A = 0,
+ B,
+ C,
+ D,
+ };
+
+ glm::mat4 vp;
+ float frustum[6][4];
+ void NormalizePlane(FrustumSide side);
+
+public:
+ Frustum() = default;
+
+ ~Frustum() = default;
+
+ void UpdateFrustum(const glm::mat4& vpmat);
+
+ //Return true, if tested point is visible
+ bool TestPoint(VectorF point);
+}; \ No newline at end of file