gwnavruntime/world/botneedfullcomputeflags.h Source File

botneedfullcomputeflags.h
Go to the documentation of this file.
1 /*
2 * Copyright 2016 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 #pragma once
8 
10 
11 
12 namespace Kaim
13 {
14 
15 
16 class BotNeedFullComputeFlags
17 {
19 
20 public:
21  // ------------------------------ Functions -----------------------------
22 
23  BotNeedFullComputeFlags() { SetDefaults(); }
24 
26  void SetDefaults()
27  {
28  m_pathEventListNeedFullCompute = true;
29  m_colliderCollectionNeedFullCompute = true;
30  m_trajectoryNeedFullCompute = true;
31  m_trajectoryFailedToFollowPath = false;
32  m_pathEventListChangedLastUpdate = false;
33  m_spatializationNeedUpdate = true;
34  m_blockingTagVolumeDeIntegrated = false;
35  m_newPathRequestRefused = false;
36  }
37 
38  bool GetPathEventListNeedFullCompute() const { return m_pathEventListNeedFullCompute; }
39  bool GetColliderCollectionNeedFullCompute() const { return m_colliderCollectionNeedFullCompute; }
40  bool GetTrajectoryNeedFullCompute() const { return m_trajectoryNeedFullCompute; }
41  bool GetTrajectoryFailedToFollowPath() const { return m_trajectoryFailedToFollowPath; }
42  bool GetPathEventListChangedLastUpdate() const { return m_pathEventListChangedLastUpdate; }
43  bool GetSpatializationNeedUpdate() const { return m_spatializationNeedUpdate; }
44  bool GetNewPathRequestRefused() const { return m_newPathRequestRefused; }
45  bool GetBlockingTagVolumeDeIntegrated() const { return m_blockingTagVolumeDeIntegrated; }
46 
47  void PathHasChanged()
48  {
49  m_trajectoryFailedToFollowPath = false;
50  m_pathEventListNeedFullCompute = true;
51  m_trajectoryNeedFullCompute = true;
52  }
53 
54  void PathEventListStartedFullCompute()
55  {
56  m_pathEventListNeedFullCompute = false; // ok PathEventList compute started
57  }
58 
59  void PathEventListHasChanged()
60  {
61  m_pathEventListChangedLastUpdate = true;
62  }
63 
64  void PathEventListUnchanged()
65  {
66  m_pathEventListChangedLastUpdate = false;
67  }
68 
69  void TrajectoryHasBeenFullyRecomputed()
70  {
71  m_trajectoryNeedFullCompute = false;
72  }
73 
74  void TrajectoryFailedToFollowPath()
75  {
76  m_trajectoryFailedToFollowPath = true;
77  }
78 
79  void ColliderCollectionHasBeenFullyRecomputed()
80  {
81  m_colliderCollectionNeedFullCompute = false;
82  }
83 
84  void EnableAvoidanceHasChanged()
85  {
86  // do nothing, avoidance is computed every frame
87  }
88 
89  void PathEventListConfigHasChanged()
90  {
91  m_pathEventListNeedFullCompute = true;
92  m_trajectoryNeedFullCompute = true;
93  }
94 
95  void ShortcutTrajectoryConfigHasChanged()
96  {
97  m_trajectoryNeedFullCompute = true;
98  }
99 
100  void SplineTrajectoryConfigHasChanged()
101  {
102  m_trajectoryNeedFullCompute = true;
103  }
104 
105  void TrajectoryModeHasChanged()
106  {
107  m_trajectoryNeedFullCompute = true;
108  }
109 
110  void ColliderCollectorConfigHasChanged()
111  {
112  m_colliderCollectionNeedFullCompute = true;
113  m_trajectoryNeedFullCompute = true;
114  }
115 
116  void AvoidanceConfigHasChanged()
117  {
118  // do nothing, avoidance is computed every frame
119  }
120 
121  void DoComputeTrajectoryHasBecomeTrue()
122  {
123  m_trajectoryNeedFullCompute = true;
124  }
125 
126  void PositionHasChanged()
127  {
128  m_spatializationNeedUpdate = true;
129  }
130 
131  void SpatializationUpdated()
132  {
133  m_spatializationNeedUpdate = false;
134  }
135 
136  void BlockingTagVolumeDeIntegrated()
137  {
138  m_blockingTagVolumeDeIntegrated = true;
139  }
140 
141  void NewPathRequestRefused()
142  {
143  m_newPathRequestRefused = true;
144  }
145 
146  void NewPathRequested()
147  {
148  m_blockingTagVolumeDeIntegrated = false;
149  m_newPathRequestRefused = false;
150  }
151 
152 public:
153  // ---------------------------------- Public Data Members ----------------------------------
154  bool m_pathEventListNeedFullCompute;
155  bool m_colliderCollectionNeedFullCompute;
156  bool m_trajectoryNeedFullCompute;
157  bool m_trajectoryFailedToFollowPath;
158  bool m_pathEventListChangedLastUpdate;
159  bool m_spatializationNeedUpdate;
160  bool m_blockingTagVolumeDeIntegrated;
161  bool m_newPathRequestRefused;
162 };
163 
164 
165 } // namespace Kaim
166 
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17