PrimeWorldEditor/Core/CFrustumPlanes.h

31 lines
737 B
C
Raw Normal View History

2015-09-27 22:02:53 +00:00
#ifndef CFRUSTUMPLANES_H
#define CFRUSTUMPLANES_H
#include <Common/CAABox.h>
#include <Common/CPlane.h>
#include <Common/CVector3f.h>
class CFrustumPlanes
{
public:
enum EFrustumSide
{
eNearPlane = 0, eFarPlane = 1,
eTopPlane = 2, eBottomPlane = 3,
eLeftPlane = 4, eRightPlane = 5
};
private:
CPlane mPlanes[6];
public:
CFrustumPlanes();
~CFrustumPlanes();
const CPlane& GetPlane(EFrustumSide side) const;
void SetPlanes(const CVector3f& position, const CVector3f& direction, float fieldOfView, float aspectRatio, float near, float far);
bool PointInFrustum(const CVector3f& point) const;
bool BoxInFrustum(const CAABox& box) const;
};
#endif // CFRUSTUMPLANES_H