mesh_mrm_skinned_instance.h

Go to the documentation of this file.
00001 
00006 /* Copyright, 2001 Nevrax Ltd.
00007  *
00008  * This file is part of NEVRAX NEL.
00009  * NEVRAX NEL is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2, or (at your option)
00012  * any later version.
00013 
00014  * NEVRAX NEL is distributed in the hope that it will be useful, but
00015  * WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00017  * General Public License for more details.
00018 
00019  * You should have received a copy of the GNU General Public License
00020  * along with NEVRAX NEL; see the file COPYING. If not, write to the
00021  * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
00022  * MA 02111-1307, USA.
00023  */
00024 
00025 #ifndef NL_MESH_MRM_SKINNED_INSTANCE_H
00026 #define NL_MESH_MRM_SKINNED_INSTANCE_H
00027 
00028 #include "nel/misc/types_nl.h"
00029 #include "nel/3d/mesh_base_instance.h"
00030 #include "nel/3d/material.h"
00031 #include "nel/3d/animated_material.h"
00032 
00033 
00034 namespace NL3D
00035 {
00036 
00037 
00038 class CMeshMRMSkinned;
00039 class CMeshMRMSkinnedGeom;
00040 class CRawSkinnedNormalCache;
00041 class CShiftedTriangleCache;
00042 
00043 
00044 // ***************************************************************************
00045 // ClassIds.
00046 const NLMISC::CClassId      MeshMRMSkinnedInstanceId=NLMISC::CClassId(0x6cfd2619, 0x2f8f36fc);
00047 
00048 
00049 // ***************************************************************************
00057 class CMeshMRMSkinnedInstance : public CMeshBaseInstance
00058 {
00059 public:
00061     static  void    registerBasic();
00062 
00063 protected:
00065     CMeshMRMSkinnedInstance()
00066     {
00067         _RawSkinCache= NULL;
00068         _ShiftedTriangleCache= NULL;
00069     }
00071     virtual ~CMeshMRMSkinnedInstance();
00072 
00073 
00075     // @{
00077     virtual bool    isSkinnable() const;
00078 
00080     virtual void    setApplySkin(bool state);
00081 
00083     virtual const std::vector<sint32>           *getSkinBoneUsage() const;
00084 
00086     virtual const std::vector<NLMISC::CBSphere> *getSkinBoneSphere() const;
00087 
00089     virtual void    renderSkin(float alphaMRM);
00090 
00091     // Implementation of SkinGrouping
00092     virtual bool            supportSkinGrouping() const;
00093     virtual sint            renderSkinGroupGeom(float alphaMRM, uint remainingVertices, uint8 *dest);
00094     virtual void            renderSkinGroupPrimitives(uint baseVertex, std::vector<CSkinSpecularRdrPass> &specularRdrPasses, uint skinIndex);
00095     virtual void            renderSkinGroupSpecularRdrPass(uint rdrPassId);
00096 
00097     virtual bool            supportShadowSkinGrouping() const;
00098     virtual sint            renderShadowSkinGeom(uint remainingVertices, uint8 *vbDest);
00099     virtual void            renderShadowSkinPrimitives(CMaterial &castMat, IDriver *drv, uint baseVertex);
00100 
00101     virtual bool            supportIntersectSkin() const;
00102     virtual bool            intersectSkin(const CMatrix &toRaySpace, float &dist2D, float &distZ, bool computeDist2D);
00103 
00105     virtual bool            getSkinBoneBBox(NLMISC::CAABBox &bbox, uint boneId);
00106 
00107     // @}
00108 
00109 
00111     // @{
00112 
00115     virtual void        changeMRMDistanceSetup(float distanceFinest, float distanceMiddle, float distanceCoarsest);
00116 
00117     virtual const   CMRMLevelDetail     *getMRMLevelDetail() const;
00118 
00119     // @}
00120 
00121     // called at instanciation
00122     void            initRenderFilterType();
00123 
00124 // *************************
00125 private:
00126     static CTransform   *creator() {return new CMeshMRMSkinnedInstance;}
00127     friend  class CMeshMRMSkinned;
00128     friend  class CMeshMRMSkinnedGeom;
00129 
00131     CRawSkinnedNormalCache      *_RawSkinCache;
00133     void                    clearRawSkinCache();
00134 
00136     CShiftedTriangleCache   *_ShiftedTriangleCache;
00138     void                    clearShiftedTriangleCache();
00139 
00140 };
00141 
00142 
00143 
00144 } // NL3D
00145 
00146 
00147 #endif // NL_MESH_MRM_SKINNED_INSTANCE_H
00148 
00149 /* End of mesh_mrm_skinned_instance.h */

Generated on Thu Jan 7 08:26:19 2010 for NeL by  doxygen 1.6.1