00001 00005 /* Copyright, 2001 Nevrax Ltd. 00006 * 00007 * This file is part of NEVRAX NEL. 00008 * NEVRAX NEL is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU General Public License as published by 00010 * the Free Software Foundation; either version 2, or (at your option) 00011 * any later version. 00012 00013 * NEVRAX NEL is distributed in the hope that it will be useful, but 00014 * WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * General Public License for more details. 00017 00018 * You should have received a copy of the GNU General Public License 00019 * along with NEVRAX NEL; see the file COPYING. If not, write to the 00020 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, 00021 * MA 02111-1307, USA. 00022 */ 00023 00024 #ifndef NL_U_TRANSFORM_H 00025 #define NL_U_TRANSFORM_H 00026 00027 #include "nel/misc/types_nl.h" 00028 #include "nel/misc/rgba.h" 00029 #include "u_instance_group.h" 00030 #include "u_transformable.h" 00031 00032 00033 namespace NL3D 00034 { 00035 00036 using NLMISC::CVector; 00037 using NLMISC::CMatrix; 00038 using NLMISC::CQuat; 00039 00040 class ILogicInfo; 00041 class CCluster; 00042 00043 // *************************************************************************** 00051 class UTransform : public UTransformable 00052 { 00053 public: 00054 // Enum should be the same than in CHrcTrav. 00055 00057 enum TVisibility 00058 { 00059 Show=0, // The model is shown in the hierarchy 00060 Hide, // The model is hidden in the hierarchy 00061 Herit, // The model herit the visibilty from his father 00062 00063 VisibilityCount 00064 }; 00065 00066 00067 public: 00068 00069 00071 // @{ 00076 void parent(UTransform newFather); 00077 00078 00079 void setClusterSystem (UInstanceGroup *pIG); 00080 UInstanceGroup *getClusterSystem () const; 00081 // @} 00082 00083 00085 // @{ 00087 void hide(); 00089 void show(); 00090 /* 00091 * Enable / disable user clipping. If enable, the transform is not clipped into the engine. 00092 * The user has to use show / hide to clip or not the transform. 00093 */ 00094 void setUserClipping(bool enable); 00096 bool getUserClipping() const; 00098 void heritVisibility(); 00100 TVisibility getVisibility(); 00101 // @} 00102 00103 00105 // @{ 00115 void freezeHRC(); 00116 00117 00120 void unfreezeHRC(); 00121 // @} 00122 00123 00125 // @{ 00131 void setUserLightable(bool enable); 00132 00135 bool getUserLightable() const ; 00136 // @} 00137 00138 00146 void setOrderingLayer(uint layer); 00147 00149 uint getOrderingLayer() const; 00150 00151 00155 void setLogicInfo(ILogicInfo *logicInfo); 00156 00157 00159 bool getLastWorldVisState() const; 00160 00162 bool getLastClippedState() const; 00163 00165 void getLastParentClusters(std::vector<CCluster*> &clusters) const; 00166 00171 const CMatrix &getLastWorldMatrixComputed() const ; 00172 00173 00175 // @{ 00176 00186 void setLoadBalancingGroup(const std::string &group); 00187 00190 const std::string &getLoadBalancingGroup() const ; 00191 00192 // @} 00193 00194 00196 // @{ 00197 00202 void setMeanColor(NLMISC::CRGBA color); 00203 00205 NLMISC::CRGBA getMeanColor() const ; 00206 00210 bool supportFastIntersect() const; 00217 bool fastIntersect(const NLMISC::CVector &p0, const NLMISC::CVector &dir, float &dist2D, float &distZ, bool computeDist2D); 00218 00219 // @} 00220 00222 // @{ 00223 void setTransparency(bool v); 00224 void setOpacity(bool v); 00225 // return a non-zero value if true 00226 uint32 isOpaque(); 00227 uint32 isTransparent(); 00233 void setBypassLODOpacityFlag(bool bypass); 00234 00240 void setTransparencyPriority(uint8 priority); 00241 // @} 00242 00244 // @{ 00248 void enableCastShadowMap(bool state); 00250 bool canCastShadowMap() const; 00251 00255 void enableReceiveShadowMap(bool state); 00257 bool canReceiveShadowMap() const ; 00258 00268 void setShadowMapDirectionZThreshold(float zthre); 00269 float getShadowMapDirectionZThreshold() const; 00270 00276 void setShadowMapMaxDepth(float depth); 00277 float getShadowMapMaxDepth() const; 00278 00279 // @} 00280 00287 void setForceClipRoot(bool forceClipRoot); 00288 bool getForceClipRoot() const; 00289 00291 00293 UTransform() { _Object = NULL; } 00294 UTransform(class CTransform *object) { _Object = (ITransformable*)object; }; 00296 void attach(class CTransform *object) { _Object = (ITransformable*)object; } 00298 void detach() { _Object = NULL; } 00300 bool empty() const {return _Object==NULL;} 00302 class CTransform *getObjectPtr() const {return (CTransform*)(_Object);} 00303 }; 00304 00305 00306 } // NL3D 00307 00308 00309 #endif // NL_U_TRANSFORM_H 00310 00311 /* End of u_transform.h */
1.6.1