Ult3D
Implementation of "Ultimate 3D Game Engine Design & Architecture" by Allan Sherrod
Loading...
Searching...
No Matches
Frustum.h
Go to the documentation of this file.
1#ifndef ULT_MATH_FRUSTUM_H_INCLUDED
2#define ULT_MATH_FRUSTUM_H_INCLUDED
3
4#include <vector>
5
6#include "Plane.h"
7#include "Vector3D.h"
8#include "OBB.h"
9
10namespace Ult
11{
12
18{
19public:
23 Frustum();
24
29 const float angle,
30 const float ratio,
31 const float near,
32 const float far,
33 const Vector3D& camPos,
34 const Vector3D& lookAt,
35 const Vector3D& up
36 );
37
41 void AddPlane(const Plane& pl);
43 bool GetPlane(const int index, Plane* out) const;
45 int GetTotalPlanes() const { return (int)mFrustum.size(); }
46
48 bool IsPointVisible(const float x, const float y, const float z);
53 bool IsSphereVisible(const float x, const float y, const float z, const float radius);
59 bool IsCubeVisible(const float x, const float y, const float z, const float size);
61 bool IsBoxVisible(const Vector3D& min, const Vector3D& max);
63 bool IsObbVisible(const OBB& obb);
64
65private:
66 std::vector<Plane> mFrustum;
67};
68
69} // namespace Ult
70
71#endif // ULT_MATH_FRUSTUM_H_INCLUDED
72
bool IsPointVisible(const float x, const float y, const float z)
Definition Frustum.cpp:96
void CalculateFrustum(const float angle, const float ratio, const float near, const float far, const Vector3D &camPos, const Vector3D &lookAt, const Vector3D &up)
Definition Frustum.cpp:19
bool IsObbVisible(const OBB &obb)
Definition Frustum.cpp:151
void AddPlane(const Plane &pl)
Definition Frustum.cpp:84
bool IsBoxVisible(const Vector3D &min, const Vector3D &max)
Definition Frustum.cpp:137
int GetTotalPlanes() const
Definition Frustum.h:45
bool IsSphereVisible(const float x, const float y, const float z, const float radius)
Definition Frustum.cpp:106
bool IsCubeVisible(const float x, const float y, const float z, const float size)
Definition Frustum.cpp:118
Frustum()
Definition Frustum.cpp:14
bool GetPlane(const int index, Plane *out) const
Definition Frustum.cpp:89
Definition OBB.h:16
Definition Plane.h:27
Definition Vector3D.h:12
Definition Archive.h:13