Emergency 20 Dokumentation  4.2.0
EPerson.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 //[-------------------------------------------------------]
14 #include "em5/map/EntityHelper.h"
15 
17 
18 
19 //[-------------------------------------------------------]
20 //[ Namespace ]
21 //[-------------------------------------------------------]
22 namespace em5
23 {
24 
25 
26  //[-------------------------------------------------------]
27  //[ Classes ]
28  //[-------------------------------------------------------]
34  {
35 
36 
37  //[-------------------------------------------------------]
38  //[ Public methods ]
39  //[-------------------------------------------------------]
40  public:
41  EPerson(qsf::Entity& entity);
42  virtual ~EPerson();
43 
44  // ::EGenericObject
45  virtual const glm::vec3& GetPosition() override { return EGenericObjectBase::GetPosition(); }
46  virtual const glm::mat3x3& GetRotationMatrix() override { return EGenericObjectBase::GetRotationMatrix(); }
47  virtual bool IsWalkable() override { return EActorBase::IsWalkable(); }
49  virtual qsf::ai::ETerrain* GetTerrain(int index) override { return EGenericObjectBase::GetTerrain(index); }
52  virtual void UpdatePlacement(glm::vec3& position_, glm::mat3x3& rotation_) override { EGenericObjectBase::UpdatePlacement(position_, rotation_); }
53  virtual int GetCarriedPersonID() const override { return EGenericObjectBase::GetCarriedPersonID(); }
54  virtual void initOwnerPlayer() override { mOwnerPlayer = EActorBase::initOwnerPlayer(); }
55 
56  // ::EPerson
57  virtual bool IsArrested() const override;
58  virtual bool IsDiver() const override;
59  virtual bool IsDrowning() const override;
60  virtual bool IsJumping() const override;
61  virtual bool IsCollisionIgnored(EActor& actor) const override;
62  virtual bool CanRunFromUnitCar() const override;
63  virtual int GetIsFollowing() const override;
64  virtual int GetLinkedPersonID() const override;
65  virtual glm::vec3 GetRelLinkPosition() const override;
66  virtual const glm::vec3& getBoundingBoxCenter() override { return mBoundingBoxCenter; }
67  virtual const glm::vec3& getBoundingBoxExtents() override { return mBoundingBoxExtents; }
68  void setBoundingBox(const glm::vec3& center, const glm::vec3& extents);
69  virtual qsf::ai::EPersonRole GetRole() const override;
70 
71  // ::EActor
72  virtual qsf::Entity& getQsfEntity() override { return mEntity; }
73  virtual bool hasTag(const qsf::StringHash& tag) const override;
74 
75  void updateRole();
76  void updateTerrainClass();
77 
78 
79  //[-------------------------------------------------------]
80  //[ Private data ]
81  //[-------------------------------------------------------]
82  private:
83  // Caching of values for performance reasons
85  qsf::ai::EObjectTerrainClass mTerrainClass;
86  EntityHelper mEntityHelper;
87  glm::vec3 mBoundingBoxCenter;
88  glm::vec3 mBoundingBoxExtents;
89 
90 
91  };
92 
93 
94 //[-------------------------------------------------------]
95 //[ Namespace ]
96 //[-------------------------------------------------------]
97 } // em5
Definition: ActionPriority.h:13
virtual const glm::mat3x3 & GetRotationMatrix() override
Definition: EPerson.h:46
virtual int GetIsFollowing() const override
EMERGENCY 5 entity helper class.
Definition: EntityHelper.h:62
virtual qsf::ai::ETerrain * GetTerrain() override
Definition: EPerson.h:48
virtual bool hasTag(const qsf::StringHash &tag) const override
virtual qsf::ai::EObjectTerrainClass GetTerrainClass() override
void updateTerrainClass()
EPersonRole
Definition: EPerson.h:29
Entity class.
Definition: Entity.h:46
const glm::vec3 & GetPosition()
virtual qsf::ai::EPersonRole GetRole() const override
EPerson()
Definition: EPerson.h:74
virtual bool IsDrowning() const override
virtual bool IsCollisionIgnored(EActor &actor) const override
void setBoundingBox(const glm::vec3 &center, const glm::vec3 &extents)
qsf::Entity & mEntity
Definition: EActorBase.h:62
virtual glm::vec3 GetRelLinkPosition() const override
Definition: terrain.h:79
void updateRole()
int GetCarriedPersonID() const
int mOwnerPlayer
Definition: EActor.h:225
void UpdatePlacement(glm::vec3 &position_, glm::mat3x3 &rotation_)
virtual ~EPerson()
virtual bool IsDiver() const override
virtual bool IsJumping() const override
EGenericObjectBase wrapper base class.
Definition: EGenericObjectBase.h:34
qsf::ai::EFloorPlacement GetPlacement()
qsf::ai::ETerrain * GetTerrain()
virtual void UpdatePlacement(glm::vec3 &position_, glm::mat3x3 &rotation_) override
Definition: EPerson.h:52
virtual bool IsWalkable() override
Definition: EPerson.h:47
virtual qsf::ai::EFloorPlacement GetPlacement() override
Definition: EPerson.h:51
virtual const glm::vec3 & GetPosition() override
Definition: EPerson.h:45
virtual int GetLinkedPersonID() const override
virtual int GetCarriedPersonID() const override
Definition: EPerson.h:53
virtual const glm::vec3 & getBoundingBoxExtents() override
Definition: EPerson.h:67
virtual bool IsArrested() const override
EFloorPlacement
Definition: EGenericObject.h:67
EObjectTerrainClass
Definition: terrain.h:51
const glm::mat3x3 & GetRotationMatrix()
virtual qsf::Entity & getQsfEntity() override
Definition: EPerson.h:72
Compile time string hash class.
Definition: StringHash.h:59
virtual void initOwnerPlayer() override
Definition: EPerson.h:54
virtual const glm::vec3 & getBoundingBoxCenter() override
Definition: EPerson.h:66
Emergency 5 implementation of EPerson wrapper class for a QSF entity.
Definition: EPerson.h:33
EPerson wrapper class for a QSF entity.
Definition: EPerson.h:48
Emergency 5 implementation of EActor wrapper class for a QSF entity.
Definition: EActor.h:32
virtual qsf::ai::ETerrain * GetTerrain(int index) override
Definition: EPerson.h:49
virtual bool CanRunFromUnitCar() const override