5#include "../core/MathUtils.h"
6#include "../core/Matrix.h"
7#include "../physics/AABB.h"
10 float a = 0.0f,
b = 0.0f,
c = 0.0f,
d = 0.0f;
13 Plane(
float _a,
float _b,
float _c,
float _d) :
a(_a),
b(_b),
c(_c),
d(_d) {}
16 float length = std::sqrt(
a *
a +
b *
b +
c *
c);
18 float invLength = 1.0f / length;
27 return a * point.
x +
b * point.
y +
c * point.
z +
d;
Axis-Aligned Bounding Box for collision detection. Defined by a Minimum and Maximum point in 3D space...
Definition AABB.h:12
Represents the camera's viewing volume. Used for Culling.
Definition Frustum.h:35
std::array< Plane, 6 > m_arrPlanes
Definition Frustum.h:52
void Update(const Core::Mat4 &viewProjMatrix)
Extracts the 6 frustum planes from the View-Projection matrix. Uses the Gribb-Hartmann method.
Definition Frustum.cpp:6
bool IsBoxInVisibleFrustum(const AABB &box) const
Checks if an AABB is visible within the frustum. Uses the "Center + Extent" method for high performan...
Definition Frustum.cpp:33
A 4x4 Matrix structure stored in Column-Major order (OpenGL Standard).
Definition Matrix.h:18
A 3-component vector structure (x, y, z) with standard math operations.
Definition MathUtils.h:11
float x
Definition MathUtils.h:12
float z
Definition MathUtils.h:12
float y
Definition MathUtils.h:12
float GetSignedDistanceToPlane(const Core::Vec3 &point) const
Definition Frustum.h:26
void Normalize()
Definition Frustum.h:15
float b
Definition Frustum.h:10
float d
Definition Frustum.h:10
float a
Definition Frustum.h:10
float c
Definition Frustum.h:10
Plane(float _a, float _b, float _c, float _d)
Definition Frustum.h:13