10 #ifndef Navigation_TagVolume_H
11 #define Navigation_TagVolume_H
24 class CylinderObstacle;
60 void Init4PointsContour(
const Vec2f& center,
const Vec2f& v1,
const Vec2f& v2);
101 WorldStatus_NotInit = 0,
103 WorldStatus_NotAdded,
107 enum IntegrationStatus
109 IntegrationStatus_NotIntegrated = 0,
110 IntegrationStatus_ToBeIntegrated,
111 IntegrationStatus_IntegrationInProcess,
112 IntegrationStatus_Integrated,
113 IntegrationStatus_ToBeDeintegrated,
114 IntegrationStatus_DeintegrationInProcess
119 ObstacleType_Undefined = 0,
120 ObstacleType_BoxObstacle,
121 ObstacleType_CylinderObstacle
128 virtual const char* GetTypeName()
const {
return "TagVolume"; }
130 static const char* GetWorldStatusDescription(WorldStatus status);
131 static const char* GetIntegrationStatusDescription(IntegrationStatus status);
132 static const char* GetObstacleTypeName(ObstacleType obstacleType);
164 const Box3f& GetAABB()
const;
168 const Vec2f* GetPoints()
const;
169 const Vec2f& GetPoint(
KyUInt32 i)
const;
170 const DynamicNavTag& GetNavTag()
const;
171 WorldStatus GetWorldStatus()
const;
172 IntegrationStatus GetIntegrationStatus()
const;
173 ObstacleType GetObstacleType()
const;
174 void* GetObstacleRawPtr()
const;
175 BoxObstacle* GetBoxObstacle()
const;
176 CylinderObstacle* GetCylinderObstacle()
const;
177 const DatabaseBinding* GetDatabaseBinding()
const;
181 virtual void DoSendVisualDebug(VisualDebugServer& server, VisualDebugSendChangeEvent changeEvent);
182 void SetObstacle(BoxObstacle* obstacle);
183 void SetObstacle(CylinderObstacle* obstacle);
184 void ResetObstacle();
186 void OnIntegrationStart();
187 void OnDeIntegrationStart();
189 void OnIntegrationDone();
190 void OnDeIntegrationDone();
192 void OnIntegrationCancelled();
193 void OnDeIntegrationCancelled();
195 const TagVolumeDatabaseData& GetTagVolumeDatabaseData()
const {
return m_tagVolumeDatabaseData; }
196 TagVolumeDatabaseData& GetTagVolumeDatabaseData() {
return m_tagVolumeDatabaseData; }
201 void SetWorld(World* world);
203 void PushPolylineFromInitConfigAccordingToWinding(
const TagVolumeInitConfig& initConfig);
208 KyArray<Vec2f, MemStat_TagVolume> m_points;
209 DynamicNavTag m_navTag;
211 TagVolumeDatabaseData m_tagVolumeDatabaseData;
214 ObstacleType m_obstacleType;
215 void* m_obstacleRawPtr;
216 TagVolumeCylinderExpander m_cylinderExpander;
217 TagVolumeBoxExpander m_boxExpander;
220 WorldStatus m_currentWorldStatus;
221 WorldStatus m_nextWorldStatus;
222 IntegrationStatus m_integrationStatus;
225 bool m_needToSendNewContextBlob;
226 bool m_needToSendTagVolumeBlob;
230 KY_INLINE
const Box3f& TagVolume::GetAABB()
const {
return m_aabb; }
231 KY_INLINE
KyFloat32 TagVolume::GetAltitudeMin()
const {
return m_aabb.
m_min.
z; }
232 KY_INLINE
KyFloat32 TagVolume::GetAltitudeMax()
const {
return m_aabb.
m_max.
z; }
233 KY_INLINE
KyUInt32 TagVolume::GetPointCount()
const {
return m_points.GetCount(); }
234 KY_INLINE
const Vec2f* TagVolume::GetPoints()
const {
return m_points.GetDataPtr(); }
235 KY_INLINE
const Vec2f& TagVolume::GetPoint(
KyUInt32 i)
const {
return m_points[i]; }
236 KY_INLINE
const DynamicNavTag& TagVolume::GetNavTag()
const {
return m_navTag; }
237 KY_INLINE TagVolume::WorldStatus TagVolume::GetWorldStatus()
const {
return m_currentWorldStatus; }
238 KY_INLINE TagVolume::IntegrationStatus TagVolume::GetIntegrationStatus()
const {
return m_integrationStatus; }
239 KY_INLINE TagVolume::ObstacleType TagVolume::GetObstacleType()
const {
return m_obstacleType; }
240 KY_INLINE
void* TagVolume::GetObstacleRawPtr()
const {
return m_obstacleRawPtr; }
242 KY_INLINE
const DatabaseBinding* TagVolume::GetDatabaseBinding()
const {
return GetTagVolumeDatabaseData().m_databaseBinding; }
243 KY_INLINE BoxObstacle* TagVolume::GetBoxObstacle()
const
245 return ((m_obstacleType == ObstacleType_BoxObstacle) ? (BoxObstacle*)m_obstacleRawPtr :
KY_NULL);
247 KY_INLINE CylinderObstacle* TagVolume::GetCylinderObstacle()
const
249 return ((m_obstacleType == ObstacleType_CylinderObstacle) ? (CylinderObstacle*)m_obstacleRawPtr :
KY_NULL);
253 KY_INLINE
void TagVolume::SetWorld(World* world)
262 #endif //Navigation_TagVolume_H
Class used to provide TagVolume initialization parameters.
Definition: tagvolume.h:36
void InitFromTagVolumeBlob(const TagVolumeBlob &blob)
neither the World nor the DatabaseBinding are set
Indicates that In each database, the altitude tolerance off the Database will be removed from Zmin...
Definition: tagvolume.h:32
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
DynamicNavTag m_navTag
This DynamicNavTag will be translated as NavTag in the DynamicNavMesh floors generated in the TagVolu...
Definition: tagvolume.h:91
KyFloat32 z
The size of the vector along the Z axis.
Definition: vec3f.h:229
void AddToWorld()
Adds the TagVolume to the World.
KyResult Init(const TagVolumeInitConfig &initConfig)
Initialize the TagVolume accordingly to the informations passed through the TagVolumeInitConfig.
void SetDefaults()
Sets all members to their default value.
Definition: tagvolume.h:50
Vec3f m_max
The maxima of the bounding box.
Definition: box3f.h:174
Indicates that In each database, the altitude tolerance off the Database will be added to Zmax...
Definition: tagvolume.h:30
General purpose array for movable objects that require explicit construction/destruction.
Definition: kyarray.h:118
#define KY_NULL
Null value.
Definition: types.h:247
TagVolumeExtendOptions
Definition: tagvolume.h:28
#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
Ptr< DatabaseBinding > m_databaseBinding
Defines the Databases in which the TagVolume will be spatialized.
Definition: tagvolume.h:87
Indicates that In each database, the altitude tolerance off the Database will be removed from Zmin...
Definition: tagvolume.h:31
This class represents runtime-defined volumes with customized NavTag.
Definition: tagvolume.h:108
This class defines a two-dimensional vector whose coordinates are stored using floating-point numbers...
Definition: vec2f.h:24
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
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
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
World * m_world
Mandatory: you must provide a World when calling TagVolume::Init().
Definition: tagvolume.h:82
Vec3f m_min
The minima of the bounding box.
Definition: box3f.h:173
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
void RemoveFromWorld()
Removes the TagVolume from the World.
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