Emergency 20 Dokumentation  4.2.0
CollisionHelper.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 
18 //[-------------------------------------------------------]
19 //[ Namespace ]
20 //[-------------------------------------------------------]
21 namespace em5
22 {
23 
24 
25  //[-------------------------------------------------------]
26  //[ Classes ]
27  //[-------------------------------------------------------]
33  {
34 
35 
36  //[-------------------------------------------------------]
37  //[ Public methods ]
38  //[-------------------------------------------------------]
39  public:
44  explicit inline CollisionHelper(qsf::Map& map);
45 
50  inline ~CollisionHelper();
51 
56  bool isInWater(qsf::Entity& entity, bool includePositionHeight = false) const;
57 
62  bool isInWater(const glm::vec3& position, bool includePositionHeight = false, float waterHeight = 1.0f) const;
63 
68  bool isInBlockedArea(const qsf::Entity& caller, qsf::Entity& target) const;
69  bool isInBlockedArea(const qsf::Entity& caller, const glm::vec3& position) const;
70 
92  bool findFreePositionEM3(const qsf::Entity& sourceEntity, const qsf::Transform& transform, float radius, float safety, glm::vec3& outPosition) const;
93  bool findFreePositionEM3(const qsf::Entity& sourceEntity, float searchRadius, float safety, glm::vec3& outPosition) const;
94  bool findFreePositionEM3(const qsf::Entity& sourceEntity, const glm::vec3& position, float searchRadius, float safety, glm::vec3& outPosition) const;
95 
96  bool hasCollisionEM3(const qsf::Entity& sourceEntity, float searchRadius, float safety) const;
97  bool hasCollisionEM3(const qsf::Entity& sourceEntity, const glm::vec3& position, float safety) const;
98  bool hasCollisionEM3(const glm::vec3& boxExtends, const qsf::Transform& transform) const;
99  bool hasCollisionEM3IgnoreEntity(const glm::vec3& boxExtends, const qsf::Transform& transform, qsf::Entity& ignoreEntity) const;
100  bool hasCollisionEM3Helilanding(const qsf::Entity& sourceEntity, const glm::vec3& position, float safety) const;
101 
102  bool findFreePositionEM3Safety(const qsf::Entity& sourceEntity, const qsf::Transform& transform, float radius1, float radius2, float radius3, float safety, glm::vec3& outPosition) const;
103 
104  bool isEntityUnderBridge(qsf::Entity& entity) const;
105 
106 
107  };
108 
109 
110 //[-------------------------------------------------------]
111 //[ Namespace ]
112 //[-------------------------------------------------------]
113 } // em5
114 
115 
116 //[-------------------------------------------------------]
117 //[ Implementation ]
118 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Entity class.
Definition: Entity.h:46
Map class.
Definition: Map.h:93
EMERGENCY 5 collision helper class.
Definition: CollisionHelper.h:32
#define EM5_API_EXPORT
Definition: Export.h:28
3D transform class
Definition: Transform.h:45
QSF collision helper class.
Definition: CollisionHelper.h:48