BVB Source Codes

CRYENGINE Show CGFSaver.h Source code

Return Download CRYENGINE: download CGFSaver.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #ifndef __CGFSaver_h__
  4. #define __CGFSaver_h__
  5.  
  6. #if defined(RESOURCE_COMPILER) || defined(INCLUDE_SAVECGF)
  7.  
  8.         #include <Cry3DEngine/CGF/CGFContent.h>
  9.  
  10.         #if defined(RESOURCE_COMPILER)
  11. class CInternalSkinningInfo;
  12.         #endif
  13.  
  14. class CChunkFile;
  15.  
  16. //////////////////////////////////////////////////////////////////////////
  17. class CSaverCGF
  18. {
  19. public:
  20.         CSaverCGF(CChunkFile& chunkFile);
  21.  
  22.         void SaveContent(CContentCGF* pCGF, bool bSwapEndian, bool bStorePositionsAsF16, bool bUseQtangents, bool bStoreIndicesAsU16);
  23.  
  24.         void SetContent(CContentCGF* pCGF);
  25.  
  26.         // Enable/Disable saving of the node mesh.
  27.         void SetMeshDataSaving(bool bEnable);
  28.  
  29.         // Enable/Disable saving of non-mesh related data.
  30.         void SetNonMeshDataSaving(bool bEnable);
  31.  
  32.         // Enable/disable saving of physics meshes.
  33.         void SetSavePhysicsMeshes(bool bEnable);
  34.  
  35.         // Enable compaction of vertex streams (for optimised streaming)
  36.         void SetVertexStreamCompacting(bool bEnable);
  37.  
  38.         // Enable computation of subset texel density
  39.         void SetSubsetTexelDensityComputing(bool bEnable);
  40.  
  41.         // Store nodes in chunk file.
  42.         #if defined(RESOURCE_COMPILER)
  43.         void SaveNodes(bool bSwapEndian, bool bStorePositionsAsF16, bool bUseQtangents, bool bStoreIndicesAsU16, CInternalSkinningInfo* pSkinningInfo);
  44.         int  SaveNode(CNodeCGF* pNode, bool bSwapEndian, bool bStorePositionsAsF16, bool bUseQtangents, bool bStoreIndicesAsU16, CInternalSkinningInfo* pSkinningInfo);
  45.         #else
  46.         void SaveNodes(bool bSwapEndian, bool bStorePositionsAsF16, bool bUseQtangents, bool bStoreIndicesAsU16);
  47.         int  SaveNode(CNodeCGF* pNode, bool bSwapEndian, bool bStorePositionsAsF16, bool bUseQtangents, bool bStoreIndicesAsU16);
  48.         #endif
  49.         void SaveMaterials(bool bSwapEndian);
  50.         int  SaveMaterial(CMaterialCGF* pMtl, bool bNeedSwap);
  51.         int  SaveExportFlags(bool bSwapEndian);
  52.  
  53.         // Compiled chunks for characters
  54.         int SaveCompiledBones(bool bSwapEndian, void* pData, int nSize, int version);
  55.         int SaveCompiledPhysicalBones(bool bSwapEndian, void* pData, int nSize, int version);
  56.         int SaveCompiledPhysicalProxis(bool bSwapEndian, void* pData, int nSize, uint32 numIntMorphTargets, int version);
  57.         int SaveCompiledMorphTargets(bool bSwapEndian, void* pData, int nSize, uint32 numIntMorphTargets, int version);
  58.         int SaveCompiledIntFaces(bool bSwapEndian, void* pData, int nSize, int version);
  59.         int SaveCompiledIntSkinVertices(bool bSwapEndian, void* pData, int nSize, int version);
  60.         int SaveCompiledExt2IntMap(bool bSwapEndian, void* pData, int nSize, int version);
  61.         int SaveCompiledBoneBox(bool bSwapEndian, void* pData, int nSize, int version);
  62.  
  63.         // Chunks for characters (for Collada->cgf export)
  64.         int  SaveBones(bool bSwapEndian, void* pData, int numBones, int nSize);
  65.         int  SaveBoneNames(bool bSwapEndian, char* boneList, int numBones, int listSize);
  66.         int  SaveBoneInitialMatrices(bool bSwapEndian, SBoneInitPosMatrix* matrices, int numBones, int nSize);
  67.         int  SaveBoneMesh(bool bSwapEndian, const PhysicalProxy& proxy);
  68.         #if defined(RESOURCE_COMPILER)
  69.         void SaveUncompiledNodes();
  70.         int  SaveUncompiledNode(CNodeCGF* pNode);
  71.         void SaveUncompiledMorphTargets();
  72.         int  SaveUncompiledNodeMesh(CNodeCGF* pNode);
  73.         int  SaveUncompiledHelperChunk(CNodeCGF* pNode);
  74.         #endif
  75.  
  76.         int SaveBreakablePhysics(bool bNeedEndianSwap);
  77.  
  78.         int SaveController829(bool bSwapEndian, const CONTROLLER_CHUNK_DESC_0829& ctrlChunk, void* pData, int nSize);
  79.         int SaveController832(bool bSwapEndian, const CONTROLLER_CHUNK_DESC_0832& ctrlChunk, void* pData, int nSize);
  80.         int SaveControllerDB905(bool bSwapEndian, const CONTROLLER_CHUNK_DESC_0905& ctrlChunk, void* pData, int nSize);
  81.  
  82.         int SaveFoliage();
  83.  
  84.         int SaveVCloth(bool bSwapEndian);
  85.  
  86.         #if defined(RESOURCE_COMPILER)
  87.         int SaveTiming(CInternalSkinningInfo* pSkinningInfo);
  88.         #endif
  89.  
  90. private:
  91.         // Return mesh chunk id
  92.         int SaveNodeMesh(CNodeCGF* pNode, bool bSwapEndian, bool bStorePositionsAsF16, bool bUseQTangents, bool bStoreIndicesAsU16);
  93.         int SaveHelperChunk(CNodeCGF* pNode, bool bSwapEndian);
  94.         int SaveMeshSubsetsChunk(CMesh& mesh, bool bSwapEndian);
  95.         int SaveStreamDataChunk(const void* pStreamData, int nStreamType, int nCount, int nElemSize, bool bSwapEndian);
  96.         int SavePhysicalDataChunk(const void* pData, int nSize, bool bSwapEndian);
  97.  
  98.         #if defined(RESOURCE_COMPILER)
  99.         int SaveTCB3Track(CInternalSkinningInfo* pSkinningInfo, int trackIndex);
  100.         int SaveTCBQTrack(CInternalSkinningInfo* pSkinningInfo, int trackIndex);
  101.         #endif
  102.  
  103. private:
  104.         CChunkFile*             m_pChunkFile;
  105.         CContentCGF*            m_pCGF;
  106.         std::set<CNodeCGF*>     m_savedNodes;
  107.         std::set<CMaterialCGF*> m_savedMaterials;
  108.         std::map<CMesh*, int>   m_mapMeshToChunk;
  109.         bool                    m_bDoNotSaveMeshData;
  110.         bool                    m_bDoNotSaveNonMeshData;
  111.         bool                    m_bSavePhysicsMeshes;
  112.         bool                    m_bCompactVertexStreams;
  113.         bool                    m_bComputeSubsetTexelDensity;
  114. };
  115.  
  116. #endif
  117. #endif
  118.  
downloadCGFSaver.h Source code - Download CRYENGINE Source code
Related Source Codes/Software:
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top