8 #ifndef Navigation_CylinderObstacle_H
9 #define Navigation_CylinderObstacle_H
20 class DatabaseBinding;
40 m_startPosition.
Set(0.0f, 0.0f, 0.0f);
61 Vec3f m_startPosition;
87 virtual const char* GetTypeName()
const {
return "CylinderObstacle"; }
125 void SetPosition(
const Vec3f& position);
142 const DynamicNavTag& GetNavTag()
const;
148 const Vec3f& GetPosition()
const;
149 const Vec3f& GetVelocity()
const;
151 bool DoesTriggerTagVolume()
const;
153 TagVolume::IntegrationStatus GetTagVolumeIntegrationStatus()
const;
158 virtual void DoSendVisualDebug(
VisualDebugServer& server, VisualDebugSendChangeEvent changeEvent);
163 void UpdateSpatialization();
172 void OnTagVolumeIntegration();
180 bool m_doesTriggerTagVolume;
182 DynamicNavTag m_navTag;
183 Ptr<DatabaseBinding> m_databaseBinding;
192 KY_INLINE
const DynamicNavTag& CylinderObstacle::GetNavTag()
const {
return m_navTag; }
194 KY_INLINE SpatializedCylinder& CylinderObstacle::GetSpatializedCylinder() {
return m_spatializedCylinder; }
195 KY_INLINE
const SpatializedCylinder& CylinderObstacle::GetSpatializedCylinder()
const {
return m_spatializedCylinder; }
196 KY_INLINE
KyFloat32 CylinderObstacle::GetRadius()
const {
return m_spatializedCylinder.GetRadius(); }
199 KY_INLINE
const Vec3f& CylinderObstacle::GetPosition()
const {
return m_position; }
200 KY_INLINE
const Vec3f& CylinderObstacle::GetVelocity()
const {
return m_velocity; }
202 KY_INLINE
void CylinderObstacle::SetPosition(
const Vec3f& position) { m_position = position; }
205 KY_INLINE
bool CylinderObstacle::DoesTriggerTagVolume()
const {
return m_doesTriggerTagVolume; }
206 KY_INLINE
const TagVolume* CylinderObstacle::GetTagVolume()
const {
return m_tagVolumeTrigger.GetTagVolume(); }
207 KY_INLINE TagVolume::IntegrationStatus CylinderObstacle::GetTagVolumeIntegrationStatus()
const {
return m_tagVolumeTrigger.GetIntegrationStatus(); }
209 KY_INLINE
const DatabaseBinding* CylinderObstacle::GetDatabaseBinding()
const {
return m_databaseBinding; }
213 KY_INLINE
void CylinderObstacle::OnTagVolumeIntegration()
215 m_spatializedCylinder.InvalidateAllDbSpatializations();
220 KY_INLINE
void CylinderObstacle::UpdateSpatialization()
222 m_tagVolumeTrigger.Update(m_doesTriggerTagVolume);
224 if (m_tagVolumeTrigger.GetIntegrationStatus() != TagVolume::IntegrationStatus_Integrated)
225 m_spatializedCylinder.UpdateSpatialization(m_position);
227 m_spatializedCylinder.SetPosition(m_position);
229 m_spatializedCylinder.SetVelocity(
m_velocity);
236 #endif // Navigation_CylinderObstacle_H
Class used to provide TagVolume initialization parameters.
Definition: tagvolume.h:36
CylinderObstacles represent dynamic objects of your game engine that prevent your Bots from moving fr...
Definition: cylinderobstacle.h:87
void ForceSendAllVisualDebug()
Call this when something impacts all your visual debug data.
World * m_world
Mandatory: you must provide a World when calling CylinderObstacle::Init.
Definition: cylinderobstacle.h:59
void Set(KyFloat32 _x, KyFloat32 _y, KyFloat32 _z)
Sets the coordinates.
Definition: vec3f.h:52
DynamicNavTag m_navTag
This DynamicNavTag will be used to set up the TagVolume NavTag when the CylinderObstacle will trigger...
Definition: cylinderobstacle.h:68
void RemoveFromWorld()
Removes the CylinderObstacle from the World: it is removed from the simulation, it is no longer updat...
#define KY_NULL
Null value.
Definition: types.h:247
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:387
This class is a runtime container for Gameware Navigation WorldElements such as NavData, Bots, BoxObstacles, TagVolumes...
Definition: world.h:54
This class represents runtime-defined volumes with customized NavTag.
Definition: tagvolume.h:108
KyFloat32 GetHeight() const
Used only for visual debugging. Not relevant for navigation.
Definition: cylinderobstacle.h:234
void SetVelocity(const Vec3f &velocity)
The CylinderObstacle velocity expressed in meter per seconds.
Definition: cylinderobstacle.h:240
TagVolumeTrigger is dedicated to TagVolume creation / removal management.
Definition: tagvolumetrigger.h:25
DatabaseBinding is a collection of the databases to be used for world elements spatialization.
Definition: databasebinding.h:24
WorldElementType
Enumerates the WorldElement types.
Definition: worldelementtype.h:15
Ptr< DatabaseBinding > m_databaseBinding
Defines the Databases in which the CylinderObstacle will be spatialized.
Definition: cylinderobstacle.h:64
KyFloat32 GetHeight() const
Note: height is only used for visual debugging, it is not relevant for navigation.
Definition: spatializedcylinder.h:137
Base internal class used to represent elements that can be added to a World, such as instances of Dat...
Definition: worldelement.h:45
Definition: gamekitcrowddispersion.h:20
void AddToWorld()
Adds the CylinderObstacle to the World: it becomes active in the simulation, it is updated...
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
void SetDefaults()
Sets all members to their default value.
Definition: cylinderobstacle.h:39
The VisualDebugServer manages the sending of data to clients.
Definition: visualdebugserver.h:254
void SetDoesTriggerTagVolume(bool triggerTagVolume)
This information is copied and applied in the next World::Update.
Definition: cylinderobstacle.h:248
Internal representation of world elements, using a vertical cylinder shape.
Definition: spatializedcylinder.h:56
void Clear()
Prepares this instance for destruction or reuse; it sets all members to their default values...
Vec3f m_velocity
The CylinderObstacle velocity expressed in meter per seconds.
Definition: cylinderobstacle.h:212
void Init(const CylinderObstacleInitConfig &initConfig)
Sets m_world and allocates memory depending on m_databaseBinding but does not add the CylinderObstacl...
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43
This class defines a three-dimensional vector whose coordinates are stored using floating-point numbe...
Definition: vec3f.h:23
Class used to provide CylinderObstacle initialization parameters.
Definition: cylinderobstacle.h:24