1 //////////////////////////////////////////////////////////////////////////////////////////
2 //	FRUSTUM.h
3 //	class declaration for frustum for frustum culling, derives from BOUNDING_VOLUME
4 //	Downloaded from: www.paulsprojects.net
5 //	Created:	13th August 2002
6 //
7 //	Copyright (c) 2006, Paul Baker
8 //	Distributed under the New BSD Licence. (See accompanying file License.txt or copy at
9 //	http://www.paulsprojects.net/NewBSDLicense.txt)
10 //////////////////////////////////////////////////////////////////////////////////////////
11 
12 #ifndef FRUSTUM_H
13 #define FRUSTUM_H
14 
15 //planes of frustum. Normals point inwards
16 enum FRUSTUM_PLANES
17 {
18 	FRUSTUM_LEFT_PLANE=0,
19 	FRUSTUM_RIGHT_PLANE,
20 	FRUSTUM_TOP_PLANE,
21 	FRUSTUM_BOTTOM_PLANE,
22 	FRUSTUM_NEAR_PLANE,
23 	FRUSTUM_FAR_PLANE
24 };
25 
26 class FRUSTUM
27 {
28 public:
29 	void SetFromMatrices(const MATRIX4X4 & view, const MATRIX4X4 & projection);
30 	void SetFromMatrix(const MATRIX4X4 & projection);
31 
32 	virtual bool IsPointInside(const VECTOR3D & point) const;
33 	virtual bool IsAABoundingBoxInside(const AA_BOUNDING_BOX & box) const;
34 	virtual int ClassifyBoundingBoxInside(const AA_BOUNDING_BOX & box) const;
35 
36 
37 	PLANE planes[6];
38 };
39 
40 #endif	//FRUSTUM_H