BVB Source Codes

CRYENGINE Show GeomCacheMeshManager.h Source code

Return Download CRYENGINE: download GeomCacheMeshManager.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. // ------------------------------------------------------------------------
  4. //  File name:   GeomCacheMeshManager.h
  5. //  Created:     18/1/2013 by Axel Gneiting
  6. //  Description: Manages static meshes for geometry caches
  7. // -------------------------------------------------------------------------
  8. //
  9. ////////////////////////////////////////////////////////////////////////////
  10.  
  11. #ifndef _GEOMCACHE_MESHMANAGER_
  12. #define _GEOMCACHE_MESHMANAGER_
  13.  
  14. #pragma once
  15.  
  16. #if defined(USE_GEOM_CACHES)
  17.  
  18.         #include <CryRenderer/IRenderMesh.h>
  19.         #include <Cry3DEngine/GeomCacheFileFormat.h>
  20.         #include "GeomCache.h"
  21.         #include <CryCore/StlUtils.h>
  22.  
  23. class CGeomCacheMeshManager
  24. {
  25. public:
  26.         void                    Reset();
  27.  
  28.         bool                    ReadMeshStaticData(CGeomCacheStreamReader& reader, const GeomCacheFile::SMeshInfo& meshInfo, SGeomCacheStaticMeshData& staticMeshData) const;
  29.         _smart_ptr<IRenderMesh> ConstructStaticRenderMesh(CGeomCacheStreamReader& reader, const GeomCacheFile::SMeshInfo& meshInfo,
  30.                                                           SGeomCacheStaticMeshData& staticMeshData, const char* pFileName);
  31.         _smart_ptr<IRenderMesh> GetStaticRenderMesh(const uint64 hash) const;
  32.         void                    RemoveReference(SGeomCacheStaticMeshData& staticMeshData);
  33. private:
  34.         bool                    ReadMeshIndices(CGeomCacheStreamReader& reader, const GeomCacheFile::SMeshInfo& meshInfo,
  35.                                                 SGeomCacheStaticMeshData& staticMeshData, std::vector<vtx_idx>& indices) const;
  36.         bool                    ReadMeshPositions(CGeomCacheStreamReader& reader, const GeomCacheFile::SMeshInfo& meshInfo, strided_pointer<Vec3> positions) const;
  37.         bool                    ReadMeshTexcoords(CGeomCacheStreamReader& reader, const GeomCacheFile::SMeshInfo& meshInfo, strided_pointer<Vec2> texcoords) const;
  38.         bool                    ReadMeshQTangents(CGeomCacheStreamReader& reader, const GeomCacheFile::SMeshInfo& meshInfo, strided_pointer<SPipTangents> tangents) const;
  39.         bool                    ReadMeshColors(CGeomCacheStreamReader& reader, const GeomCacheFile::SMeshInfo& meshInfo, strided_pointer<UCol> colors) const;
  40.  
  41.         struct SMeshMapInfo
  42.         {
  43.                 _smart_ptr<IRenderMesh> m_pRenderMesh;
  44.                 uint                    m_refCount;
  45.         };
  46.  
  47.         // Map from mesh hash to render mesh
  48.         typedef std::unordered_map<uint64, SMeshMapInfo> TMeshMap;
  49.         TMeshMap m_meshMap;
  50. };
  51.  
  52. #endif
  53. #endif
  54.  
downloadGeomCacheMeshManager.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