00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef __NEFRUSTUM_H
00028 #define __NEFRUSTUM_H
00029
00030
00031 #include "base.h"
00032 #include "node.h"
00033 #include "plane.h"
00034
00035
00041 namespace NeoEngine
00042 {
00043
00044
00045
00046 class Line;
00047 class Plane;
00048
00049
00059 class NEOENGINE_API Frustum : public SRTNode
00060 {
00061 public:
00062
00067 enum FRUSTUMPLANE
00068 {
00069 LEFT = 0,
00070 RIGHT = 1,
00071 TOP = 2,
00072 BOTTOM = 3,
00073 FRONT = 4,
00074 BACK = 5,
00075 NUMPLANES = 6
00076 };
00077
00078
00079 public:
00080
00082 unsigned char m_aiPVertexSign[6][3];
00083
00085 unsigned char m_aiNVertexSign[6][3];
00086
00088 Matrix m_kViewMatrix;
00089
00091 Plane m_akPlanes[6];
00092
00094 Vector3d m_kDirection;
00095
00097 float m_fZNear;
00098
00100 float m_fZFar;
00101
00102
00106 Frustum();
00107
00113 virtual bool Intersection( const Vector3d &rkPoint );
00114
00120 virtual bool Intersection( const Line &rkLine );
00121
00127 virtual bool Intersection( const Plane &rkPlane );
00128
00137 virtual bool Intersection( const Vector3d &rkV0, const Vector3d &rkV1, const Vector3d &rkV2, const Vector3d &rkNormal = Vector3d::ORIGO );
00138 };
00139
00140
00141 };
00142
00143
00144 #endif