gwnavruntime/queries/utils/traversalparams.h Source File

traversalparams.h
Go to the documentation of this file.
1 /*
2 * Copyright 2015 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 
8 // Primary contact: JUBA - secondary contact: NOBODY
9 #ifndef Navigation_TraversalParams_H
10 #define Navigation_TraversalParams_H
11 
15 
16 namespace Kaim
17 {
18 
22 class TraversalParameters
23 {
24 public:
25  // ---------------------------------- Main API functions ----------------------------------
26 
27  KyUInt32 GetNumberOfProcessedNodePerFrame() const;
28  KyFloat32 GetFromOutsideNavMeshDistance() const;
29  KyFloat32 GetToOutsideNavMeshDistance() const;
30 
31  PathFinderAbstractGraphTraversalMode GetAbstractGraphTraversalMode() const;
32  const PositionSpatializationRange& GetPositionSpatializationRange() const;
33 
34 public: // Internal
35  TraversalParameters() { SetDefaults(KY_NULL); }
36  virtual ~TraversalParameters() {}
37 
38  // public because can be used by the Bot basic path finding helper functions
39  void SetDefaults(Database* database)
40  {
46  m_abstractGraphTraversalMode = PATHFINDER_TRAVERSE_ABSTRACT_GRAPHS;
47 
48  if (database != KY_NULL)
49  SetPositionSpatializationRange(database->GetPositionSpatializationRange());
50  }
51 
52  void SetNumberOfProcessedNodePerFrame(KyUInt32 numberOfProcessedNodePerFrame);
53  void SetPositionSpatializationRange(const PositionSpatializationRange& positionSpatializationRange);
54  void SetFromOutsideNavMeshDistance(KyFloat32 fromOutsideNavMeshDistance);
55  void SetToOutsideNavMeshDistance(KyFloat32 toOutsideNavMeshDistance);
56  void SetAbstractGraphTraversalMode(PathFinderAbstractGraphTraversalMode abstractGraphTraversalMode);
57 
58 public: // Internal
60  PositionSpatializationRange m_positionSpatializationRange;
61 
69 
77 
80 
83 
86 
89  CellBox m_startActiveDataCellBoxForAbstractGraph;
90  CellBox m_destActiveDataCellBoxForAbstractGraph;
91 };
92 
93 
94 KY_INLINE void TraversalParameters::SetFromOutsideNavMeshDistance(KyFloat32 fromOutsideNavMeshDistance) { m_fromOutsideNavMeshDistance = fromOutsideNavMeshDistance; }
95 KY_INLINE void TraversalParameters::SetToOutsideNavMeshDistance(KyFloat32 toOutsideNavMeshDistance) { m_toOutsideNavMeshDistance = toOutsideNavMeshDistance; }
96 KY_INLINE void TraversalParameters::SetNumberOfProcessedNodePerFrame(KyUInt32 numberOfProcessedNodePerFrame) { m_numberOfVisitedNodePerFrame = numberOfProcessedNodePerFrame; }
97 
98 KY_INLINE KyFloat32 TraversalParameters::GetFromOutsideNavMeshDistance() const { return m_fromOutsideNavMeshDistance; }
99 KY_INLINE KyFloat32 TraversalParameters::GetToOutsideNavMeshDistance() const { return m_toOutsideNavMeshDistance; }
100 KY_INLINE KyUInt32 TraversalParameters::GetNumberOfProcessedNodePerFrame() const { return m_numberOfVisitedNodePerFrame; }
101 
102 KY_INLINE const PositionSpatializationRange& TraversalParameters::GetPositionSpatializationRange() const { return m_positionSpatializationRange; }
103 KY_INLINE void TraversalParameters::SetPositionSpatializationRange(const PositionSpatializationRange& positionSpatializationRange)
104 {
105  m_positionSpatializationRange = positionSpatializationRange;
106 }
107 
108 KY_INLINE void TraversalParameters::SetAbstractGraphTraversalMode(PathFinderAbstractGraphTraversalMode abstractGraphTraversalMode)
109 {
110  m_abstractGraphTraversalMode = abstractGraphTraversalMode;
111 }
112 
113 KY_INLINE PathFinderAbstractGraphTraversalMode TraversalParameters::GetAbstractGraphTraversalMode() const
114 {
116 }
117 
118 }
119 
120 #endif //Navigation_TraversalParams_H
121 
This class represents a two-dimensional axis-aligned bounding box whose dimensions are stored using 3...
Definition: box2i.h:119
KyUInt32 m_numberOfIntersectionTestPerFrame
The number of intersections that will be processed each frame during the clamper part of the query...
Definition: traversalparams.h:97
#define KY_NULL
Null value.
Definition: types.h:247
KyFloat32 m_fromOutsideNavMeshDistance
The maximum distance from the start along the X axis and along the Y axis that will be searched for N...
Definition: traversalparams.h:78
An internal class that stores parameters used to control the propagation of traversals through the Na...
Definition: traversalparams.h:23
This class is a runtime container for all NavData that represents the world from the point of view of...
Definition: database.h:64
PathFinderAbstractGraphTraversalMode
Enumerates the possible way of dealing with AbstractGraphs.
Definition: pathfinderabstractgraphtraversalmode.h:16
KyUInt32 m_numberOfVisitedNodePerFrame
The number of nodes that will be processed each frame during the traversal part of the AStar...
Definition: traversalparams.h:91
Definition: gamekitcrowddispersion.h:20
PathFinderAbstractGraphTraversalMode m_abstractGraphTraversalMode
Indicates if the traversal should traverse AbstractGraphs.
Definition: traversalparams.h:100
KyUInt32 m_numberOfCanGoTestInRefinerPerFrame
The number of CanGo tests that will be processed each frame during the refiner part of the query...
Definition: traversalparams.h:94
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
PositionSpatializationRange m_positionSpatializationRange
The altitude range used to find NavMesh triangles that correspond to the start and destination points...
Definition: traversalparams.h:68
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43
KyFloat32 m_toOutsideNavMeshDistance
The maximum distance from the destination along the X axis and along the Y axis that will be searched...
Definition: traversalparams.h:88