BVB Source Codes

CRYENGINE Show GeomCacheDecoder.h Source code

Return Download CRYENGINE: download GeomCacheDecoder.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:   GeomCacheDecoder.h
  5. //  Created:     23/8/2012 by Axel Gneiting
  6. //  Description: Decodes geom cache data
  7. // -------------------------------------------------------------------------
  8. //
  9. ////////////////////////////////////////////////////////////////////////////
  10.  
  11. #ifndef _GEOMCACHE_DECODER_
  12. #define _GEOMCACHE_DECODER_
  13.  
  14. #pragma once
  15.  
  16. #if defined(USE_GEOM_CACHES)
  17.  
  18.         #include <Cry3DEngine/GeomCacheFileFormat.h>
  19.  
  20. class CGeomCache;
  21. struct SGeomCacheRenderMeshUpdateContext;
  22. struct SGeomCacheStaticMeshData;
  23.  
  24. struct SGeomCacheFrameHeader
  25. {
  26.         enum EFrameHeaderState
  27.         {
  28.                 eFHS_Uninitialized = 0,
  29.                 eFHS_Undecoded     = 1,
  30.                 eFHS_Decoded       = 2
  31.         };
  32.  
  33.         EFrameHeaderState m_state;
  34.         uint32            m_offset;
  35. };
  36.  
  37. namespace GeomCacheDecoder
  38. {
  39. // Decodes an index frame
  40. void DecodeIFrame(const CGeomCache* pGeomCache, char* pData);
  41.  
  42. // Decodes a bi-directional predicted frame
  43. void DecodeBFrame(const CGeomCache* pGeomCache, char* pData, char* pPrevFramesData[2],
  44.                   char* pFloorIndexFrameData, char* pCeilIndexFrameData);
  45.  
  46. bool PrepareFillMeshData(SGeomCacheRenderMeshUpdateContext& updateContext, const SGeomCacheStaticMeshData& staticMeshData,
  47.                          const char*& pFloorFrameMeshData, const char*& pCeilFrameMeshData, size_t& offsetToNextMesh, float& lerpFactor);
  48.  
  49. void FillMeshDataFromDecodedFrame(const bool bMotionBlur, SGeomCacheRenderMeshUpdateContext& updateContext,
  50.                                   const SGeomCacheStaticMeshData& staticMeshData, const char* pFloorFrameMeshData,
  51.                                   const char* pCeilFrameMeshData, float lerpFactor);
  52.  
  53. // Gets total needed space for uncompressing successive blocks
  54. uint32 GetDecompressBufferSize(const char* const pStartBlock, const uint numFrames);
  55.  
  56. // Decompresses one block of compressed data with header for input
  57. bool DecompressBlock(const GeomCacheFile::EBlockCompressionFormat compressionFormat, char* const pDest, const char* const pSource);
  58.  
  59. // Decompresses blocks of compressed data with headers for input and output
  60. bool DecompressBlocks(const GeomCacheFile::EBlockCompressionFormat compressionFormat, char* const pDest,
  61.                       const char* const pSource, const uint blockOffset, const uint numBlocks, const uint numHandleFrames);
  62.  
  63. Vec3 DecodePosition(const Vec3& aabbMin, const Vec3& aabbSize, const GeomCacheFile::Position& inPosition, const Vec3& convertFactor);
  64. Vec2 DecodeTexcoord(const GeomCacheFile::Texcoords& inTexcoords);
  65. Quat DecodeQTangent(const GeomCacheFile::QTangent& inQTangent);
  66.  
  67. void TransformAndConvertToTangentAndBitangent(const Quat& rotation, const Quat& inQTangent, SPipTangents& outTangents);
  68. void ConvertToTangentAndBitangent(const Quat& inQTangent, SPipTangents& outTangents);
  69. };
  70.  
  71. #endif
  72. #endif
  73.  
downloadGeomCacheDecoder.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