Home | nevrax.com |
|
clip_trav.hGo to the documentation of this file.00001 00007 /* Copyright, 2000 Nevrax Ltd. 00008 * 00009 * This file is part of NEVRAX NEL. 00010 * NEVRAX NEL is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2, or (at your option) 00013 * any later version. 00014 00015 * NEVRAX NEL is distributed in the hope that it will be useful, but 00016 * WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 * General Public License for more details. 00019 00020 * You should have received a copy of the GNU General Public License 00021 * along with NEVRAX NEL; see the file COPYING. If not, write to the 00022 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, 00023 * MA 02111-1307, USA. 00024 */ 00025 00026 #ifndef NL_CLIP_TRAV_H 00027 #define NL_CLIP_TRAV_H 00028 00029 #include "3d/trav_scene.h" 00030 #include "3d/quad_grid.h" 00031 #include "nel/misc/vector.h" 00032 #include "nel/misc/plane.h" 00033 #include "nel/misc/matrix.h" 00034 00035 00036 namespace NL3D 00037 { 00038 00039 using NLMISC::CVector; 00040 using NLMISC::CPlane; 00041 using NLMISC::CMatrix; 00042 00043 00044 class IBaseClipObs; 00045 class CRenderTrav; 00046 class CAnimDetailTrav; 00047 class CLoadBalancingTrav; 00048 class CHrcTrav; 00049 class CLightTrav; 00050 class CCluster; 00051 class CInstanceGroup; 00052 class CCamera; 00053 class CQuadGridClipManager; 00054 class CRootModel; 00055 class CTransformClipObs; 00056 00057 00058 // *************************************************************************** 00059 // This is the order of clip planes. 00060 #define NL3D_CLIP_PLANE_NEAR 0 00061 #define NL3D_CLIP_PLANE_FAR 1 00062 #define NL3D_CLIP_PLANE_LEFT 2 00063 #define NL3D_CLIP_PLANE_TOP 3 00064 #define NL3D_CLIP_PLANE_RIGHT 4 00065 #define NL3D_CLIP_PLANE_BOTTOM 5 00066 00067 00068 // *************************************************************************** 00069 // ClassIds. 00070 const NLMISC::CClassId ClipTravId=NLMISC::CClassId(0x135208fe, 0x225334fc); 00071 00072 // *************************************************************************** 00091 class CClipTrav : public ITravCameraScene 00092 { 00093 public: 00094 00096 CClipTrav(); 00097 ~CClipTrav(); 00098 00100 00101 IObs *createDefaultObs () const; 00102 NLMISC::CClassId getClassId () const {return ClipTravId;} 00103 sint getRenderOrder () const {return 2000;} 00104 void traverse (); 00106 00107 void registerCluster (CCluster* pCluster); 00108 void unregisterCluster (CCluster* pCluster); 00109 00111 void setHrcTrav (CHrcTrav* trav); 00112 void setAnimDetailTrav(CAnimDetailTrav *trav); 00113 void setLoadBalancingTrav(CLoadBalancingTrav *trav); 00114 void setLightTrav (CLightTrav* trav); 00115 void setRenderTrav (CRenderTrav* trav); 00116 void setQuadGridClipManager(CQuadGridClipManager *mgr); 00117 00118 00119 bool fullSearch (std::vector<CCluster*>& result, CInstanceGroup *pIG, CVector& pos); 00120 00122 00123 // For ClipObservers only. NB: list is cleared at begining of traverse(). 00124 void addVisibleObs(CTransformClipObs *obs); 00126 00127 00128 void setSonsOfAncestorSkeletonModelGroup(CRootModel *m); 00129 00130 public: 00131 00136 00137 std::vector<CPlane> ViewPyramid; 00139 std::vector<CPlane> WorldFrustumPyramid; 00141 std::vector<CPlane> WorldPyramid; 00143 CHrcTrav *HrcTrav; 00144 CAnimDetailTrav *AnimDetailTrav; 00145 CLoadBalancingTrav *LoadBalancingTrav; 00146 CLightTrav *LightTrav; 00147 CRenderTrav *RenderTrav; 00149 sint64 CurrentDate; 00150 00151 CCluster *RootCluster; 00152 CCamera *Camera; 00153 00154 CQuadGrid<CCluster*> Accel; 00155 00159 bool ForceNoFrustumClip; 00160 00161 00162 // For skeleton stickObject. 00163 CRootModel *SonsOfAncestorSkeletonModelGroup; 00164 00165 private: 00166 friend class IBaseClipObs; 00167 00168 std::vector<CTransformClipObs*> _VisibleList; 00169 00170 CQuadGridClipManager *_QuadGridClipManager; 00171 }; 00172 00173 00174 00175 } 00176 00177 00178 #endif // NL_CLIP_TRAV_H 00179 00180 /* End of clip_trav.h */ |