BVB Source Codes

CRYENGINE Show GameVolumesManager.h Source code

Return Download CRYENGINE: download GameVolumesManager.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #ifndef _GAME_VOLUMES_MANAGER_H_
  4. #define _GAME_VOLUMES_MANAGER_H_
  5.  
  6. #pragma once
  7.  
  8. #include <CryGame/IGameVolumes.h>
  9.  
  10. class CGameVolumesManager : public IGameVolumes, IGameVolumesEdit
  11. {
  12.  
  13. private:
  14.  
  15.         typedef std::vector<Vec3> Vertices;
  16.         struct EntityVolume
  17.         {
  18.                 EntityVolume()
  19.                         : entityId(0)
  20.                         , height(0.0f)
  21.                         , closed(false)
  22.                 {
  23.                 }
  24.  
  25.                 bool operator==(const EntityId& id) const
  26.                 {
  27.                         return entityId == id;
  28.                 }
  29.  
  30.                 EntityId entityId;
  31.                 f32      height;
  32.                 bool     closed;
  33.                 Vertices vertices;
  34.         };
  35.  
  36.         typedef std::vector<EntityVolume>  TEntityVolumes;
  37.         typedef std::vector<IEntityClass*> TVolumeClasses;
  38.  
  39. public:
  40.         CGameVolumesManager();
  41.         virtual ~CGameVolumesManager();
  42.  
  43.         // IGameVolumes
  44.         virtual IGameVolumesEdit* GetEditorInterface();
  45.         virtual bool              GetVolumeInfoForEntity(EntityId entityId, VolumeInfo* pOutInfo) const;
  46.         virtual void              Load(const char* fileName);
  47.         virtual void              Reset();
  48.         // ~IGameVolumes
  49.  
  50.         // IGameVolumesEdit
  51.         virtual void        SetVolume(EntityId entityId, const IGameVolumes::VolumeInfo& volumeInfo);
  52.         virtual void        DestroyVolume(EntityId entityId);
  53.  
  54.         virtual void        RegisterEntityClass(const char* className);
  55.         virtual size_t      GetVolumeClassesCount() const;
  56.         virtual const char* GetVolumeClass(size_t index) const;
  57.  
  58.         virtual void        Export(const char* fileName) const;
  59.         // ~IGameVolumesEdit
  60.  
  61. private:
  62.  
  63.         TEntityVolumes      m_volumesData; // Level memory
  64.         TVolumeClasses      m_classes;     // Global memory, initialized at start-up
  65.  
  66.         const static uint32 GAME_VOLUMES_FILE_VERSION = 2;
  67. };
  68.  
  69. #endif
  70.  
downloadGameVolumesManager.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