Emergency 20 Dokumentation  4.2.0
TreeFallDownAnimation.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 
15 #include <qsf/base/WeakPtr.h>
16 #include <qsf/job/JobProxy.h>
17 
18 
19 //[-------------------------------------------------------]
20 //[ Forward declarations ]
21 //[-------------------------------------------------------]
22 namespace qsf
23 {
24  class Entity;
25  class LinkComponent;
26 }
27 namespace em5
28 {
29  class TreeComponent;
30 }
31 
32 
33 //[-------------------------------------------------------]
34 //[ Namespace ]
35 //[-------------------------------------------------------]
36 namespace em5
37 {
38 
39 
40  //[-------------------------------------------------------]
41  //[ Classes ]
42  //[-------------------------------------------------------]
48  {
49 
50 
51  //[-------------------------------------------------------]
52  //[ Public methods ]
53  //[-------------------------------------------------------]
54  public:
59  TreeFallDownAnimation(TreeComponent& treeComponent, qsf::Entity& firefighterEntity);
60 
66 
67  void start();
68 
69 
70  //[-------------------------------------------------------]
71  //[ Private methods ]
72  //[-------------------------------------------------------]
73  private:
74  void updateAnimation(const qsf::JobArguments& jobArgs);
75 
76 
77  //[-------------------------------------------------------]
78  //[ Private definitions ]
79  //[-------------------------------------------------------]
80  private:
81  enum State
82  {
83  STATE_INIT,
84  STATE_WAITING,
85  STATE_TREE_FALLING,
86  STATE_TREE_CUT
87  };
88 
89 
90  //[-------------------------------------------------------]
91  //[ Private data ]
92  //[-------------------------------------------------------]
93  private:
94  qsf::WeakPtr<TreeComponent> mTreeComponent;
95  qsf::WeakPtr<qsf::LinkComponent> mLinkComponent;
96  qsf::WeakPtr<qsf::Entity> mFirefighter;
97  qsf::JobProxy mUpdateJob;
98 
99  // State
100  State mState;
101  float mSecondsPassed;
102  float mLastDegree;
103  glm::vec3 mFallAxis;
104 
105 
106  };
107 
108 
109 //[-------------------------------------------------------]
110 //[ Namespace ]
111 //[-------------------------------------------------------]
112 } // em5
Definition: ActionPriority.h:13
Job proxy class.
Definition: JobProxy.h:51
Entity class.
Definition: Entity.h:46
EMERGENCY 5 tree fall down animation.
Definition: TreeFallDownAnimation.h:47
#define EM5_API_EXPORT
Definition: Export.h:28
Lightweight weak pointer implementation.
Definition: WeakPtr.h:133
Job arguments class: holds data to be passed to the called job method by the job manager.
Definition: JobArguments.h:40
Definition: PickupPersonByParamedicAction.h:21
EMERGENCY 5 tree component class.
Definition: TreeComponent.h:44