Emergency 20 Dokumentation  4.2.0
WaterjetComponent-inl.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2018 Promotion Software GmbH
2 
3 
4 //[-------------------------------------------------------]
5 //[ Namespace ]
6 //[-------------------------------------------------------]
7 namespace em5
8 {
9 
10 
11  //[-------------------------------------------------------]
12  //[ Public methods ]
13  //[-------------------------------------------------------]
15  {
16  return mTargetEntityId;
17  }
18 
20  {
21  if (entityId == 0)
22  {
23  qsf::setUninitialized(entityId);
24  }
25 
26  assignAndPromoteChange(mTargetEntityId, entityId, TARGET_ENTITY_ID);
27  }
28 
30  {
31  return mAngleInRadians;
32  }
33 
34  inline void WaterjetComponent::setAngleInRadians(float angle)
35  {
36  if (mAngleInRadians != angle)
37  {
38  mAngleInRadians = angle;
39 
40  // Update waterjet
41  mLastDistance = 0.0f;
42 
45  }
46  }
47 
49  {
50  return glm::degrees(mAngleInRadians);
51  }
52 
53  inline void WaterjetComponent::setAngleInDegrees(float angle)
54  {
55  setAngleInRadians(glm::radians(angle));
56  }
57 
58  inline float WaterjetComponent::getStartRadius() const
59  {
60  return mStartRadius;
61  }
62 
63  inline void WaterjetComponent::setStartRadius(float startRadius)
64  {
65  if (mStartRadius != startRadius)
66  {
67  mStartRadius = startRadius;
68 
69  // Update waterjet
70  mLastDistance = 0.0f;
71 
73  }
74  }
75 
76  inline float WaterjetComponent::getEndRadius() const
77  {
78  return mEndRadius;
79  }
80 
81  inline void WaterjetComponent::setEndRadius(float endRadius)
82  {
83  if (mEndRadius != endRadius)
84  {
85  mEndRadius = endRadius;
86 
87  // Update waterjet
88  mLastDistance = 0.0f;
89 
91  }
92  }
93 
95  {
96  return mEndRadiusYFactor;
97  }
98 
99  inline void WaterjetComponent::setEndRadiusYFactor(float endRadiusYFactor)
100  {
101  if (mEndRadiusYFactor != endRadiusYFactor)
102  {
103  mEndRadiusYFactor = endRadiusYFactor;
104 
105  // Update waterjet
106  mLastDistance = 0.0f;
107 
109  }
110  }
111 
113  {
114  return mEndBottomLapse;
115  }
116 
117  inline void WaterjetComponent::setEndBottomLapse(float endBottomLapse)
118  {
119  if (mEndBottomLapse != endBottomLapse)
120  {
121  mEndBottomLapse = endBottomLapse;
122 
123  // Update waterjet
124  mLastDistance = 0.0f;
125 
127  }
128  }
129 
131  {
132  return mDisableAllParticles;
133  }
134 
136  {
137  if (mDisableAllParticles != state)
138  {
139  mDisableAllParticles = state;
140 
141  if (isRunning() && state)
142  {
143  destroyParticles();
144  }
145 
147  }
148  }
149 
151  {
152  return mDisableCollisionChecks;
153  }
154 
156  {
157  if (mDisableCollisionChecks != state)
158  {
159  mDisableCollisionChecks = state;
160 
161  // Update waterjet
162  mLastDistance = 0.0f;
163 
165  }
166  }
167 
169  {
170  return mHitEntityId;
171  }
172 
173  inline const glm::vec3& WaterjetComponent::getHitPosition() const
174  {
175  return mHitPosition;
176  }
177 
178  inline const glm::vec3& WaterjetComponent::getHitGroundPosition() const
179  {
180  return mHitGroundPosition;
181  }
182 
183 
184 //[-------------------------------------------------------]
185 //[ Namespace ]
186 //[-------------------------------------------------------]
187 } // em5
Definition: ActionPriority.h:13
float getAngleInRadians() const
Definition: WaterjetComponent-inl.h:29
void setAngleInDegrees(float angleInDegree)
Definition: WaterjetComponent-inl.h:53
static const uint32 ANGLE_IN_RADIANS
Definition: WaterjetComponent.h:60
static const uint32 DISABLE_COLLISION_CHECKS
Definition: WaterjetComponent.h:67
uint64 getHitEntityId() const
Definition: WaterjetComponent-inl.h:168
static const uint32 DISABLE_ALL_PARTICLES
Definition: WaterjetComponent.h:66
bool getDisableCollisionChecks() const
Definition: WaterjetComponent-inl.h:150
bool isRunning() const
Return whether or not the component is up-and-running.
Definition: Component-inl.h:67
bool getDisableAllParticles() const
Definition: WaterjetComponent-inl.h:130
uint64_t uint64
Definition: PlatformTypes.h:184
float getAngleInDegrees() const
Definition: WaterjetComponent-inl.h:48
const glm::vec3 & getHitGroundPosition() const
Definition: WaterjetComponent-inl.h:178
void setEndRadius(float endRadius)
Definition: WaterjetComponent-inl.h:81
void setTargetEntityId(uint64 entityId)
Definition: WaterjetComponent-inl.h:19
const glm::vec3 & getHitPosition() const
Definition: WaterjetComponent-inl.h:173
void setEndBottomLapse(float endBottomLapse)
Definition: WaterjetComponent-inl.h:117
float getEndRadius() const
Definition: WaterjetComponent-inl.h:76
float getStartRadius() const
Definition: WaterjetComponent-inl.h:58
static const uint32 ANGLE_IN_DEGREES
Definition: WaterjetComponent.h:59
static const uint32 END_BOTTOM_LAPSE
Definition: WaterjetComponent.h:64
static const uint32 END_RADIUS
Definition: WaterjetComponent.h:62
static const uint32 TARGET_ENTITY_ID
Definition: WaterjetComponent.h:58
void setDisableAllParticles(bool state)
Definition: WaterjetComponent-inl.h:135
void promotePropertyChange(uint32 propertyId)
A component property value was changed.
void setEndRadiusYFactor(float endRadiusYFactor)
Definition: WaterjetComponent-inl.h:99
void setAngleInRadians(float angleInRadians)
Definition: WaterjetComponent-inl.h:34
float getEndRadiusYFactor() const
Definition: WaterjetComponent-inl.h:94
void setDisableCollisionChecks(bool state)
Definition: WaterjetComponent-inl.h:155
static const uint32 END_RADIUS_Y_FACTOR
Definition: WaterjetComponent.h:63
static const uint32 START_RADIUS
Definition: WaterjetComponent.h:61
void setUninitialized(T &value)
Definition: GetUninitialized.h:52
void setStartRadius(float startRadius)
Definition: WaterjetComponent-inl.h:63
float getEndBottomLapse() const
Definition: WaterjetComponent-inl.h:112
uint64 getTargetEntityId() const
Definition: WaterjetComponent-inl.h:14
bool assignAndPromoteChange(T &variable, const S &newValue, uint32 propertyId)
Comfort function for updating an exported member variable and promoting any change that happened...
Definition: Component-inl.h:141