7 #ifndef Navigation_ChannelComputerConfig_H
8 #define Navigation_ChannelComputerConfig_H
18 class AdvancedChannelComputerConfig
23 AdvancedChannelComputerConfig();
29 bool operator==(const AdvancedChannelComputerConfig& other) const;
30 bool operator!=(const AdvancedChannelComputerConfig& other) const;
46 KyFloat32 m_minDistBetweenIntermediaryGates;
52 KyFloat32 m_maxDistBetweenIntermediaryGates;
61 inline
void SwapEndianness(Endianness::Target e, AdvancedChannelComputerConfig& self)
63 SwapEndianness(e,
self.m_turnSamplingAngleDeg);
64 SwapEndianness(e,
self.m_channelSmoothingAngleDeg);
65 SwapEndianness(e,
self.m_minDistBetweenIntermediaryGates);
66 SwapEndianness(e,
self.m_maxDistBetweenIntermediaryGates);
67 SwapEndianness(e,
self.m_gateCollapseWidth);
71 class ChannelComputerConfig
90 AdvancedChannelComputerConfig m_advancedConfig;
95 SwapEndianness(e,
self.m_channelRadius);
103 KY_INLINE AdvancedChannelComputerConfig::AdvancedChannelComputerConfig() { SetDefaults(); }
105 KY_INLINE
void AdvancedChannelComputerConfig::SetDefaults()
107 m_turnSamplingAngleDeg = 30.0f;
108 m_channelSmoothingAngleDeg = 30.0f;
109 m_minDistBetweenIntermediaryGates = 0.5f;
110 m_maxDistBetweenIntermediaryGates = 10.f;
111 m_gateCollapseWidth = 0.01f;
114 KY_INLINE
bool AdvancedChannelComputerConfig::IsValid()
116 return (m_turnSamplingAngleDeg > 0.0f)
117 && (m_minDistBetweenIntermediaryGates > 0.0f)
118 && (m_maxDistBetweenIntermediaryGates > m_minDistBetweenIntermediaryGates)
119 && (m_gateCollapseWidth >= 0.0f);
122 KY_INLINE
bool AdvancedChannelComputerConfig::operator==(
const AdvancedChannelComputerConfig& other)
const
124 return (m_turnSamplingAngleDeg == other.m_turnSamplingAngleDeg )
125 && (m_channelSmoothingAngleDeg == other.m_channelSmoothingAngleDeg )
126 && (m_minDistBetweenIntermediaryGates == other.m_minDistBetweenIntermediaryGates)
127 && (m_maxDistBetweenIntermediaryGates == other.m_maxDistBetweenIntermediaryGates)
128 && (m_gateCollapseWidth == other.m_gateCollapseWidth );
131 KY_INLINE
bool AdvancedChannelComputerConfig::operator!=(
const AdvancedChannelComputerConfig& other)
const {
return !operator==(other); }
137 KY_INLINE ChannelComputerConfig::ChannelComputerConfig() { SetDefaults(); }
139 KY_INLINE
void ChannelComputerConfig::SetDefaults()
141 m_channelRadius = 4.0f;
142 m_advancedConfig.SetDefaults();
145 KY_INLINE
bool ChannelComputerConfig::IsValid()
147 return m_channelRadius > 0.f
148 && m_advancedConfig.IsValid();
151 KY_INLINE
bool ChannelComputerConfig::operator==(
const ChannelComputerConfig& other)
const
153 return m_channelRadius == other.m_channelRadius
154 && m_advancedConfig == other.m_advancedConfig;
157 KY_INLINE
bool ChannelComputerConfig::operator!=(
const ChannelComputerConfig& other)
const {
return !operator==(other); }
161 #endif // Navigation_ChannelComputerConfig_H
Class that aggregates parameters that allow to configure the channel computation of a Bot...
Definition: channelcomputerconfig.h:76
Collects endianness types and utilities used in the blob serialization framework. ...
Definition: endianness.h:23
Definition: gamekitcrowddispersion.h:20
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43