Emergency 20 Dokumentation  4.2.0
BuildingClippingManager.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2018 Promotion Software GmbH
2 
3 
4 //[-------------------------------------------------------]
5 //[ Header guard ]
6 //[-------------------------------------------------------]
7 #pragma once
8 
9 
10 //[-------------------------------------------------------]
11 //[ Includes ]
12 //[-------------------------------------------------------]
13 #include "em5/Export.h"
14 
16 
17 #include <unordered_set>
18 
19 
20 //[-------------------------------------------------------]
21 //[ Forward declarations ]
22 //[-------------------------------------------------------]
23 namespace Ogre
24 {
25  class Camera;
26 }
27 namespace em5
28 {
29  class BuildingComponent;
30 }
31 namespace qsf
32 {
33  class Map;
34  class MeshComponent;
35  class CameraComponent;
36 }
37 
38 
39 //[-------------------------------------------------------]
40 //[ Namespace ]
41 //[-------------------------------------------------------]
42 namespace em5
43 {
44 
45 
46  //[-------------------------------------------------------]
47  //[ Classes ]
48  //[-------------------------------------------------------]
54  {
55 
56 
57  //[-------------------------------------------------------]
58  //[ Friends ]
59  //[-------------------------------------------------------]
60  friend class BuildingComponent;
61 
62 
63  //[-------------------------------------------------------]
64  //[ Public definitions ]
65  //[-------------------------------------------------------]
66  public:
67  typedef std::unordered_set<uint64> EntityIdSet;
68 
69 
70  //[-------------------------------------------------------]
71  //[ Public methods ]
72  //[-------------------------------------------------------]
73  public:
75  virtual ~BuildingClippingManager();
76  inline bool isBuildingClippingEnabled() const;
77  void setBuildingClippingEnabled(bool buildingClippingEnabled);
78  inline void setVisibilityCheckEnabled(bool visibilityCheckEnabled);
79 
80 
81  //[-------------------------------------------------------]
82  //[ Private methods ]
83  //[-------------------------------------------------------]
84  private:
85  void onBuildingComponentRendered(const qsf::MeshComponent& meshComponent, BuildingComponent& buildingComponent, const Ogre::Camera& ogreCamera);
86  void endEntityClipping(uint64 entityId) const;
87 
95  void onPreCompositorWorkspaceUpdate(const qsf::CameraComponent& cameraComponent);
96 
97 
98  //[-------------------------------------------------------]
99  //[ Private data ]
100  //[-------------------------------------------------------]
101  private:
102  qsf::Map& mMap;
103  bool mBuildingClippingEnabled;
104  EntityIdSet mBuildingCameraIntersectionRootEntityIdSet;
105  EntityIdSet mBuildingCameraIntersectionEntityIdSet;
106  EntityIdSet mBuildingCameraIntersectionWorkingEntityIdSet;
107  bool mVisibilityCheckEnabled;
108 
109 
110  };
111 
112 
113 //[-------------------------------------------------------]
114 //[ Namespace ]
115 //[-------------------------------------------------------]
116 } // em5
117 
118 
119 //[-------------------------------------------------------]
120 //[ Implementation ]
121 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
EMERGENCY 5 building component class.
Definition: BuildingComponent.h:56
Map class.
Definition: Map.h:93
#define EM5_API_EXPORT
Definition: Export.h:28
Camera component class.
Definition: CameraComponent.h:50
uint64_t uint64
Definition: PlatformTypes.h:184
Abstract manager interface.
Definition: Manager.h:40
Definition: PickupPersonByParamedicAction.h:21
std::unordered_set< uint64 > EntityIdSet
Definition: BuildingClippingManager.h:67
Mesh component class.
Definition: MeshComponent.h:51
EMERGENCY 5 building clipping manager.
Definition: BuildingClippingManager.h:53
Definition: BuildingClippingManager.h:23