8 #ifndef Navigation_AvoidanceConfig_H
9 #define Navigation_AvoidanceConfig_H
19 class AvoidanceCapConfig
24 AvoidanceCapConfig() { SetDefaults(); }
26 bool operator==(
const AvoidanceCapConfig& other)
const;
27 bool operator!=(
const AvoidanceCapConfig& other)
const {
return !operator==(other); }
32 bool m_capAvoidanceAngleChange;
36 bool m_capAvoidanceSpeedChange;
48 class AvoidanceContactSolverConfig
53 AvoidanceContactSolverConfig() { SetDefaults(); }
55 bool operator==(
const AvoidanceContactSolverConfig& other)
const;
56 bool operator!=(
const AvoidanceContactSolverConfig& other)
const {
return !operator==(other); }
62 bool m_enableSoftContactSolver;
66 bool m_enableBypassContactOverTime;
78 class AvoidanceUtilityFunctionConfig
83 AvoidanceUtilityFunctionConfig() { SetDefaults(); }
85 bool operator==(
const AvoidanceUtilityFunctionConfig& other)
const;
86 bool operator!=(
const AvoidanceUtilityFunctionConfig& other)
const {
return !operator==(other); }
111 class AvoidanceConfig
116 AvoidanceConfig() { SetDefaults(); }
120 bool operator!=(
const AvoidanceConfig& other)
const {
return !operator==(other); }
180 KY_INLINE
void AvoidanceCapConfig::SetDefaults()
182 m_capAvoidanceAngleChange =
true;
183 m_capAvoidanceSpeedChange =
false;
184 m_maxAngularVelocityChange = 360.0f;
185 m_maxLinearSpeedChange = 8.0f;
188 KY_INLINE
bool AvoidanceCapConfig::operator==(
const AvoidanceCapConfig& other)
const
190 return m_capAvoidanceAngleChange == other.m_capAvoidanceAngleChange
191 && m_capAvoidanceSpeedChange == other.m_capAvoidanceSpeedChange
192 && m_maxAngularVelocityChange == other.m_maxAngularVelocityChange
193 && m_maxLinearSpeedChange == other.m_maxLinearSpeedChange;
197 KY_INLINE
void AvoidanceUtilityFunctionConfig::SetDefaults()
199 m_avoidanceAngleSpan = 90.0f;
200 m_avoidanceSampleCount = 20;
202 m_avoidanceInfluence = 0.8f;
203 m_desiredVelocityInfluence = 0.15f;
204 m_previousVelocityInfluence = 0.05f;
207 KY_INLINE
bool AvoidanceUtilityFunctionConfig::operator==(
const AvoidanceUtilityFunctionConfig& other)
const
209 return m_avoidanceAngleSpan == other.m_avoidanceAngleSpan
210 && m_avoidanceSampleCount == other.m_avoidanceSampleCount
211 && m_avoidanceInfluence == other.m_avoidanceInfluence
212 && m_desiredVelocityInfluence == other.m_desiredVelocityInfluence
213 && m_previousVelocityInfluence == other.m_previousVelocityInfluence;
217 KY_INLINE
void AvoidanceContactSolverConfig::SetDefaults()
219 m_enableSoftContactSolver =
false;
220 m_enableBypassContactOverTime =
false;
221 m_contactBypassingTimeLimit = 1.0f;
222 m_contactBypassingRatio = 0.9f;
224 KY_INLINE
bool AvoidanceContactSolverConfig::operator==(
const AvoidanceContactSolverConfig& other)
const
226 return m_enableSoftContactSolver == other.m_enableSoftContactSolver
227 && m_enableBypassContactOverTime == other.m_enableBypassContactOverTime
228 && m_contactBypassingTimeLimit == other.m_contactBypassingTimeLimit
229 && m_contactBypassingRatio == other.m_contactBypassingRatio;
233 KY_INLINE
void AvoidanceConfig::SetDefaults()
243 m_forcePassageTimeLimit = 0.5f;
251 KY_INLINE
bool AvoidanceConfig::operator==(
const AvoidanceConfig& other)
const
261 && m_forcePassageTimeLimit == other.m_forcePassageTimeLimit
272 #endif // Navigation_AvoidanceComputerConfig_H
Set of parameters used to configure AvoidanceComputer.
Definition: avoidanceconfig.h:117
bool m_enableSlowingDown
If set to true, velocity candidates with reduced speed will be considered; else only velocity candida...
Definition: avoidanceconfig.h:141
AvoidanceCapConfig m_capConfig
Cap changes in the avoidance output velocity.
Definition: avoidanceconfig.h:189
KyFloat32 m_waitPassageTimeLimit
If m_enableForcePassage is true, passage is forced for at most m_forcePassageTimeLimit seconds only a...
Definition: avoidanceconfig.h:164
KyFloat32 m_stopWaitTime
If the entity stopped, wait stopWaitTime seconds before moving again.
Definition: avoidanceconfig.h:155
KyFloat32 m_minimalTimeToCollision
If an obstacle may collide another one in m_minimalTimeToCollision seconds, take it into account for ...
Definition: avoidanceconfig.h:179
bool m_enableStop
If set to true, null velocity candidate will be considered; else the AvoidanceSolver will never consi...
Definition: avoidanceconfig.h:147
Definition: gamekitcrowddispersion.h:20
KyFloat32 m_safetyDistance
Safety distance around collider to avoid moving too close.
Definition: avoidanceconfig.h:183
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
AvoidanceContactSolverConfig m_contactSolverConfig
Soft-Physics Contact Solver config.
Definition: avoidanceconfig.h:192
KyFloat32 m_stopCollisionTime
If a collision cannot be avoided in less that stopCollisionTime seconds, the entity will stop...
Definition: avoidanceconfig.h:151
AvoidanceUtilityFunctionConfig m_utilityFunctionConfig
Various parameters of the utility function defining how candidate velocities for avoidance are scored...
Definition: avoidanceconfig.h:186
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
bool m_enableForcePassage
If set to true, solutions with collisions are allowed if no other solutions are found after a while...
Definition: avoidanceconfig.h:160
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43