gwnavruntime/world/bot.h Source File

bot.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 // primary contact: BRGR - secondary contact: LAPA
8 #ifndef Navigation_Bot_H
9 #define Navigation_Bot_H
10 
11 
29 
30 
31 namespace Kaim
32 {
33 
34 class Database;
35 class BaseNavigationProfile;
36 class BasePathProgressComputer;
37 class BaseAStarQuery;
38 class IPathEventListObserver;
39 class IMovePositionOnLivePathPredicate;
40 class IPathFinderQuery;
41 class Bot;
42 class SplineInputBlobDumpConfig;
43 
45 class BotOutput
46 {
49 
50 public: // internal
51  BotOutput();
52  void Reset(const Vec2f& frontDirection = Vec2f::Zero());
53 
54 public:
55  // --- Path status ---
56 
57  bool IsPathRecomputationNeeded() const; // tells if a path must be recomputed
58  UpperBoundType GetUpperBoundType() const; // current type of the upperBound
59  PositionOnPath GetUpperBound() const; // position of the UpperBound
60 
61 public:
62  // --- Bot movement ---
63 
64  Vec3f m_outputVelocity; // 2d in NavMesh, 3d in OutOfNavMesh
65  Vec2f m_outputFrontDirection; // normalized Vec2f
66 
67  // --- Avoidance ---
68 
69  AvoidanceResult m_avoidanceResult; // previously AvoidanceResult
70  bool m_hasCollided; // did the avoidance solved a collision
71 
72 public: // internal
73  Bot* m_bot;
74 };
75 
76 
78 class BotInitConfig
79 {
81 
82 public:
83  // ---------------------------------- Public Member Functions ----------------------------------
84 
85  BotInitConfig() { SetDefaults(); }
86 
90  void SetDefaults()
91  {
92  m_userData = KY_NULL;
95  m_startFrontDirection = Vec2f::UnitX();
97  }
98 
99 
100  // ---------------------------------- Public Data Members ----------------------------------
101 
102  void* m_userData;
103 
106 
109  Ptr<DatabaseBinding> m_databaseBinding;
110 
113 
114  Vec3f m_startPosition;
115  Vec3f m_startVelocity;
116  Vec2f m_startFrontDirection;
117 };
118 
121 class Bot : public WorldElement
122 {
123  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_Bot)
125 
126 public:
127  static WorldElementType GetStaticType() { return TypeBot; }
128  virtual WorldElementType GetType() const { return TypeBot; }
129 
130  virtual const char* GetTypeName() const { return "Bot"; }
131 
132  // ---------------------------------- Initialization / Clearing ----------------------------------
133 
134  Bot();
135 
137  Bot(const BotInitConfig& initConfig);
140  Bot(const BotInitConfig& initConfig, const BotConfig& botConfig);
142  virtual ~Bot();
143 
145  void Init(const BotInitConfig& initConfig);
146 
150  void Init(const BotInitConfig& initConfig, const BotConfig& botConfig);
151 
154  void Clear();
155 
163  void AddToDatabase();
164 
171  void RemoveFromDatabase();
172 
173 
174  // ---------------------------------- BotInput ----------------------------------
178 
181  void SetPosition(const Vec3f& position);
182 
186  void SetVelocity(const Vec3f& velocity);
187 
190  void SetFrontDirection(const Vec2f& frontDirection);
191 
193  void SetPositionAndVelocityAndFrontDirection(const Vec3f& position, KyFloat32 simulationTimeInSeconds);
194 
196  void SetPositionAndVelocity(const Vec3f& position, KyFloat32 simulationTimeInSeconds);
197 
199  void SetVelocityAndFrontDirection(const Vec3f& velocity);
200 
201  // ---------------------------------- BotOutput ----------------------------------
202 
204  const BotOutput& GetBotOutput() const;
205 
206 
207  // ---------------------------------- Getters ----------------------------------
208 
209  const Vec3f& GetPosition() const;
210  const Vec2f& GetFrontDirection() const;
211  const Vec3f& GetVelocity() const;
212 
214 
215  const Vec3f& GetPreviousPosition() const;
216 
218  const ChannelSectionPtr& GetChannelSectionPtr() const;
219 
220  Database* GetDatabase() const;
221  IPathFinderQuery* GetPathFinderQuery();
222  BasePathProgressComputer* GetPathProgressComputer() const;
223  Trajectory* GetTrajectory() const;
224 
225  const PositionOnLivePath& GetProgressOnLivePath() const;
226  ProgressOnPathStatus GetProgressOnLivePathStatus() const;
227  static const char* GetProgressOnLivePathStatusDescription(ProgressOnPathStatus status);
228 
232 
233  const BotConfig& GetConfig() const;
234 
235  // ---------------------------------- Bot Shape Config ----------------------------------
236 
240  void SetRadius(KyFloat32 radius);
241  KyFloat32 GetRadius() const;
242 
244  void SetHeight(KyFloat32 height);
245  KyFloat32 GetHeight() const;
246 
247  // ---------------------------------- Trajectory Mode ----------------------------------
248 
252  void SetTrajectoryMode(TrajectoryMode trajectoryMode);
253  TrajectoryMode GetTrajectoryMode() const;
254 
255  // ---------------------------------- PathFind Config ----------------------------------
256 
258  void SetPathFinderConfig(const PathFinderConfig& pathFinderConfig);
259  const PathFinderConfig& GetPathFinderConfig() const;
260 
262  void SetChannelComputerConfig(const ChannelComputerConfig& channelComputerConfig);
263  const ChannelComputerConfig& GetChannelComputerConfigConfig() const;
264 
265  // ---------------------------------- Path Progress Config ----------------------------------
266 
269  void SetPathProgressConfig(const PathProgressConfig& pathProgressConfig);
270  const PathProgressConfig& GetPathProgressConfig() const;
271 
272  // ---------------------------------- Trajectory Config ----------------------------------
273 
275  void SetMaxDesiredLinearSpeed(KyFloat32 maxDesiredLinearSpeed);
276  KyFloat32 GetMaxDesiredLinearSpeed() const;
277 
279  void SetTrajectoryFailureMode(TrajectoryFailureMode trajectoryFailureMode);
280  TrajectoryFailureMode GetTrajectoryFailureMode() const;
281 
283  void SetShortcutTrajectoryConfig(const ShortcutTrajectoryConfig& shortcutTrajectoryConfig);
284  const ShortcutTrajectoryConfig& GetShortcutTrajectoryConfig() const;
285 
287  void SetSplineTrajectoryConfig(const SplineTrajectoryConfig& splineTrajectoryConfig);
288  const SplineTrajectoryConfig& GetSplineTrajectoryConfig() const;
289 
290  // ---------------------------------- Trajectory Avoidance ----------------------------------
291 
293  void SetEnableAvoidance(bool enable);
294  bool GetEnableAvoidance() const;
295 
297  void SetColliderCollectorConfig(const ColliderCollectorConfig& colliderCollectorConfig);
298  const ColliderCollectorConfig& GetColliderCollectorConfig() const;
299 
301  void SetAvoidanceConfig(const AvoidanceConfig& avoidanceConfig);
302  const AvoidanceConfig& GetAvoidanceConfig() const;
303 
304  // ---------------------------------- Advanced Config ----------------------------------
305 
307  void SetTrajectoryMinimalMoveDistance(KyFloat32 trajectoryMinimalMoveDistance);
308  KyFloat32 GetTrajectoryMinimalMoveDistance() const;
309 
312  void SetLocalCostOnPathDistance(KyFloat32 localCostOnPathDistance);
313  KyFloat32 GetLocalCostOnPathDistance() const;
314 
315 
316  // ---------------------------------- Basic PathFinding functions ----------------------------------
320 
323  void SetNewPathNavigationProfileId(KyUInt32 navigationProfileId);
324  KyUInt32 GetNewPathNavigationProfileId() const;
325 
335  KyResult ComputeNewPathToDestination(const Vec3f& destPos, const NavGraphEdgePtr& startNavGraphEdgePtr, NavGraphEdgeDirection navGraphEdgePathfindMode = NAVGRAPHEDGE_BIDIRECTIONAL);
336 
337 
338  // ---------------------------------- Advanced PathFinding functions ----------------------------------
342 
346  KyResult InitAStarQueryForBot(Ptr<BaseAStarQuery>& astarQuery, const Vec3f& destPos);
347 
351  KyResult InitAStarQueryForBot(Ptr<BaseAStarQuery>& astarQuery, const Vec3f& destPos,
352  const NavGraphEdgePtr& startNavGraphEdgePtr, NavGraphEdgeDirection navGraphEdgePathfindMode = NAVGRAPHEDGE_BIDIRECTIONAL);
353 
356 
357  void* GetBotTraverseLogicUserData() const;
358  void SetBotTraverseLogicUserData(void* traverseLogicUserData);
359 
365  void ComputeNewPathAsync(IPathFinderQuery* pathFinderQuery);
366 
374  void InjectNewPath(Path* newPath);
375 
380 
384  bool IsComputingNewPath() const;
385 
386 
387  // ---------------------------------- LivePath Management ----------------------------------
388 
389  const LivePath& GetLivePath() const;
390  const PathEventList& GetPathEventList() const;
391  const PathValidityInterval& GetPathValidityInterval() const;
392  Path* GetFollowedPath() const;
393  PathSource GetFollowedPathSource() const;
394  ChannelArray* GetChannelArray() const;
395 
399  void ClearFollowedPath();
400 
408 
414  const NavTag* GetUpcomingEventNavTag() const;
415 
421  const NavTag* GetPreviousEventNavTag() const;
422 
423 
424  // ---------------------------------- Path Following ----------------------------------
425 
429  bool HasReachedPosition(const Vec3f& position, KyFloat32 precisionRadius) const;
430 
439  void SetDoComputeProgressOnPath(bool doUpdateProgressOnPath);
440  bool GetDoComputeProgressOnPath() const;
441 
449  void SetDoValidateCheckPoint(bool doValidateCheckPoint);
450  bool GetDoValidateCheckPoint() const;
451 
456  void SetDoComputeTrajectory(bool doComputeTrajectory);
457  bool GetDoComputeTrajectory() const;
458  void ForceRecomputeTrajectory();
459 
460 
465  Vec3f ComputeMoveOnNavMesh(const Kaim::Vec3f& velocity, KyFloat32 simulationTimeInSeconds);
466 
471  template<class TraverseLogic>
472  Vec3f ComputeMoveOnNavMeshWithTraverseLogic(const Kaim::Vec3f& velocity, KyFloat32 simulationTimeInSeconds);
473 
474  // ---------------------------------- Manual Control helper ----------------------------------
484 
494 
506  ManualControlStatus EnterManualControl(const NavTag* navTag);
507  ManualControlStatus EnterManualControl(const DynamicNavTag* navTag);
508 
516 
526  void SetForceMinimizedSpatializationCoherency(bool forceMinimalCoherency);
527  bool GetForceMinimizedSpatializationCoherency() const;
528 
529 public: // internal
530  // Main function of the Bot. Called for each bot in World::Update() every frame
531  void UpdatePathFollowing(KyFloat32 simulationTimeInSeconds);
532 
533  void ComputeTrajectory(KyFloat32 simulationTimeInSeconds);
534 
535  // Tests if the trajectory can be reset from the given positionOnLivePath, if possible set m_progressOnLivePath to positionOnLivePath
536  // Called internally by ExitManualControl
537  ResetTrajectoryStatus ResetTrajectory(const PositionOnLivePath& positionOnLivePath);
538 
539  virtual void DoSendVisualDebug(VisualDebugServer& server, VisualDebugSendChangeEvent changeEvent); // Inherited from WorldElement
540 
541  // Bot spatialization through its SpatializedCylinder, must only be called into World::Update
542  void UpdateSpatialization();
543 
544  // LivePath management
545  LivePath& GetLivePath();
546  PathEventList& GetPathEventList();
547  void FlagPathAsPotentiallyDirty(); // Called in EventBroadcaster to trigger a path validity check after NavData has changed
548 
549  void ComputeBotRadiusAndHeight();
550 
551  NavTrianglePtr GetNavTrianglePtr(Database* boundDatabase) const; // return the triangle corresponding to m_position in the given Database, this database must be one of the DatabaseBinding, this function can imply a lazy update
552 
553 public: // KY_DEPRECATED
554  KY_DEPRECATED(void SetDoMaximizeSpatializationCoherency(bool maximizeCoherency)) { SetForceMinimizedSpatializationCoherency(!maximizeCoherency); } // Minimize better reflect what it does
555  KY_DEPRECATED(bool GetDoMaximizeSpatializationCoherency()) { return !GetForceMinimizedSpatializationCoherency(); } // Minimize better reflect what it does
556 
557 private:
558  void SetDefaults();
559  void ResetPathFindingAndFollowingStates();
560  void SetupBotRadiusCappedToGenerationMetrics();
561  void SetupBotHeightCappedToGenerationMetrics();
562  void SendPathFinderErrorDisplayList();
563  void ReplaceFollowedPathWithNewPath();
564  void SetTrajectory(Trajectory* trajectory);
565 
566  SpatializationUpdateCoherency GetSpatializationUpdateCoherency() const;
567  PointSpatialization& GetPositionSpatialization() const; // can imply a lazy update of m_positionSpatialization and m_botNeedFullComputeFlags
568 
569  // If ShortcutTrajectory is in use it allows to skip some PathFollowing computations on several frames.
570  // cf. World::SetNumberOfFramesForShortcutTrajectoryPeriodicUpdate()
571  bool IsShortcutTrajectoryAllowingToSkipPathFollowingThisFrame(KyFloat32& simulationTimeInSecondsToApplyThisFrame);
572 
573 public: // internal
574  Database* m_database;
575  void* m_traverseLogicUserData;
576 
577  Ptr<IPathFinderQuery> m_pathFinderQuery;
578 
579  // current navigation components
580  Ptr<BasePathProgressComputer> m_pathProgressComputer;
581  Ptr<Trajectory> m_trajectory;
582 
583  // Members relative to Path and Spatialization.
584  LivePath m_livePath; // Maintain Path and runtime information such as its validity
585  SpatializedCylinder m_spatializedCylinder; // Spatialization of the bot in Databases, contains position, velocity and navTriganle at last World::Update()
586  ChannelSectionPtr m_positionInChannel; // Position of the bot in ChannelArray
587  PositionOnLivePath m_progressOnLivePath; // Progress of the bot along the path so far, it never goes backward on the path
588  ProgressOnPathStatus m_progressOnPathStatus; // Status relative to m_progressOnLivePath
589  Vec3f m_previousPosition; // Position passed the previous frame. Used for arrival and checkpoint validation.
590  ManualControlInterval m_manualControlInterval;
591  KyFloat32 m_localMaxCostMultiplierOnPath; // Used by LocalCostAwarTraverseLogic
592 
593  // position, velocity and direction provided by user to be applied on SpatializedCylinder in next World::Update
594  Vec3f m_position; // user input position
595  Vec3f m_velocity; // user input velocity
596  Vec2f m_frontDirection; // user input frontDirection
597 
598  // output position, velocity and direction recommended by Navigation to be applied after World::Update call
599  BotOutput m_botOutput;
600 
601  // NavigationProfiles
602  KyUInt32 m_newPathToDestNavigationProfileId;
603  BotNavigationCollection m_botNavigationCollection; // the per-Bot per-NavigationProfile data
604 
605  // flags to force recompute on next Update
606  mutable BotNeedFullComputeFlags m_botNeedFullComputeFlags;
607 
608  // ColliderCollector per bot data
609  Vec3f m_lastCollectorPosition;
610  Ptr<QueryDynamicOutput> m_collectorOutput;
611 
612  KyFloat32 m_forcePassageTimer; // for internal use, negative value indicates the passage is being forced, positive value indicates when waiting, 0 otherwise
613  KyFloat32 m_colliderTimer; // Increase when colliding, decrease when not, never negative
614 
615 private:
616  Ptr<BotConfig> m_botConfig;
617 
618  bool m_forceMinimizedSpatializationCoherency;
619  // NavTriangle based on user input position i.e. the NavTriangle for m_position which can differ from m_spatializedCylinder,
620  // also note that m_spatializedCylinder is referenced into NavFloor whereas m_positionSpatialization is not!
621  mutable PointSpatialization m_positionSpatialization;
622 
623  bool m_doComputeProgressOnPath;
624  bool m_doValidateCheckPoint;
625  bool m_doComputeTrajectory;
626 
627  // VisualDebug
628  BotVisualDebug m_visualDebug;
629 
630 public: // debug
631  Ptr<SplineInputBlobDumpConfig> m_advancedDebug_InputBlobDumpConfig;
632 };
633 
634 } // namespace Kaim
635 
637 
638 #endif // Navigation_Bot_H
BaseNavigationProfile and its derivation NavigationProfile is a class that simplifies ...
Definition: basenavigationprofile.h:34
void ComputeNewPathAsync(IPathFinderQuery *pathFinderQuery)
Launches a new path computation with a pathFinderQuery.
Definition: bot.inl:73
void SetForceMinimizedSpatializationCoherency(bool forceMinimalCoherency)
By default, Spatialization coherency is maximized, you can force minimization here.
Definition: bot.inl:24
This class is the world element that represent an active character in Gameware Navigation.
Definition: bot.h:150
TrajectoryMode
Enum that defines the 2 possible trajectories modes.
Definition: botconfig.h:31
Base class for all pathfinder queries.
Definition: ipathfinderquery.h:38
KyFloat32 GetRemainingDistanceFromProgressToEndOfPath() const
Return the remaining distance from the ProgressOnPath to the end of the followed path along the path...
void SetShortcutTrajectoryConfig(const ShortcutTrajectoryConfig &shortcutTrajectoryConfig)
The Trajectory will be recomputed the frame after this call.
const Vec3f & GetPreviousPosition() const
Returns the Bot position known at the previous World::Update. This can be used to achieve much more p...
Definition: bot.inl:137
Set of parameters used to configure AvoidanceComputer.
Definition: avoidanceconfig.h:117
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
void SetDoComputeProgressOnPath(bool doUpdateProgressOnPath)
When set to true, m_progressOnLivePath will be automatically updated in Bot::UpdatePathFollowing() ba...
This class aggregates all necessary information about a position on a Path, namely: ...
Definition: positiononpath.h:33
const Vec2f & GetFrontDirection() const
The moving direction from BotInput passed by the user.
Definition: bot.inl:130
PathEventList aggregates all PathEvents and PathEventIntervals in a PathValidityInterval.
Definition: patheventlist.h:141
void SetDoValidateCheckPoint(bool doValidateCheckPoint)
When set to true, the Bot ProgressOnPath will be block at PathEvent CheckPoints until the IPositionOn...
Definition: bot.inl:75
Class that configures how the Bot collects colliders (other bots, obstacles) around.
Definition: collidercollectorconfig.h:19
void SetEnableAvoidance(bool enable)
EnableAvoidance impacts the Trajectory, the Trajectory will be recomputed after this call...
static Vec2f UnitX()
Returns the normalized orientation of the X axis.
Definition: vec2f.h:157
void SetMaxDesiredLinearSpeed(KyFloat32 maxDesiredLinearSpeed)
The Trajectory will be recomputed the frame after this call.
void SetVelocity(const Vec3f &velocity)
The actual velocity of your entity might differ from the one we gave you in the trajectory because of...
Definition: bot.inl:101
void SetPositionAndVelocity(const Vec3f &position, KyFloat32 simulationTimeInSeconds)
For convenience, deduce velocity from previous position.
Definition: bot.inl:113
Class that aggregates parameters that allow to configure the progress of a Bot on its path...
Definition: pathprogressconfig.h:62
BaseNavigationProfile * GetFollowedPathNavigationProfile()
Get the NavigationProfile of the currently followed Path.
TrajectoryFailureMode
Enum that defines the 2 possible behaviors in case Trajectory cannot follow the path e...
Definition: botconfig.h:43
void SetDoComputeTrajectory(bool doComputeTrajectory)
When set to false, the Bot will no more compute the Trajectory.
Class that aggregates parameters that allow to configure the channel computation of a Bot...
Definition: channelcomputerconfig.h:76
const Vec3f & GetPosition() const
The position from BotInput passed by the user.
Definition: bot.inl:129
void AddToDatabase()
Adds the Bot to the Database (and thus to the World).
void SetTrajectoryMode(TrajectoryMode trajectoryMode)
Trajectory will be recomputed the frame after this call.
#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 aggregates Channels along a Path.
Definition: channelarray.h:31
Database * m_database
Mandatory: you must provide a valid Database on which the Bot will move.
Definition: bot.h:134
ProgressOnPathStatus
Enumerates the possible status values of Bot Position on path.
Definition: progressonpathstatus.h:14
void InjectNewPath(Path *newPath)
Set a new Path, considered as the path to follow, at the next World::Update.
Definition: bot.inl:64
void SetFrontDirection(const Vec2f &frontDirection)
Optional: your entities might face a direction that is different from the velocity.
Definition: bot.inl:102
NavTrianglePtr GetNavTrianglePtr() const
Returns the triangle corresponding to SetPosition() into m_database.
Definition: bot.inl:136
AvoidanceResult
Enumerates the possible results of a call to IAvoidanceComputer::Compute().
Definition: iavoidancecomputer.h:20
BotOutput gathers the most important outputs of a bot for easy access.
Definition: bot.h:45
Class that configures how the trajectory is computed from the Channel.
Definition: splinetrajectoryconfig.h:31
void SetAvoidanceConfig(const AvoidanceConfig &avoidanceConfig)
The Trajectory will be recomputed after this call.
KyUInt32 m_startNewPathNavigationProfileId
NavigationProfile that will be used in the ComputeNewPathToDestination() calls.
Definition: bot.h:141
void SetColliderCollectorConfig(const ColliderCollectorConfig &colliderCollectorConfig)
The Trajectory will be recomputed the frame after this call.
This class is a runtime container for all NavData that represents the world from the point of view of...
Definition: database.h:64
This class defines a two-dimensional vector whose coordinates are stored using floating-point numbers...
Definition: vec2f.h:24
const NavTag * GetUpcomingEventNavTag() const
Returns a pointer to the navTag along the path after m_progressOnLivePath.
PathSource
Enumerates the possible source for a new Path.
Definition: livepath.h:44
void SetTrajectoryMinimalMoveDistance(KyFloat32 trajectoryMinimalMoveDistance)
Set the Bot TrajectoryMinimalMoveDistance (cf BotConfig::m_trajectoryMinimalMoveDistance), nothing in particular will be recomputed after this call.
Definition: bot.inl:52
void SetRadius(KyFloat32 radius)
Radius only impacts other surrounding bots avoidance.
void SetPositionAndVelocityAndFrontDirection(const Vec3f &position, KyFloat32 simulationTimeInSeconds)
For convenience, set position and deduce velocity from previous position as well as frontDirection...
Definition: bot.inl:104
void CancelAsyncPathComputation()
Cancel the current path computation.
Definition: bot.inl:63
KyResult ComputeNewPathToDestination(const Vec3f &destPos)
Launches an asynchronous path computation from the Bot position to destPos.
Definition: bot.inl:71
WorldElementType
Enumerates the WorldElement types.
Definition: worldelementtype.h:15
const Vec3f & GetVelocity() const
The velocity vector from BotInput passed by the user.
Definition: bot.inl:131
ResetTrajectoryStatus ExitManualControl()
If EnterManualControl() was called without NavTag then the current m_progressOnLivePath is used...
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
ManualControlStatus EnterManualControl()
Call this function if you wish to take manual control of the Bot, i.e.
The abstract base class for PathProgressComputer classes.
Definition: basepathprogresscomputer.h:37
Ptr< DatabaseBinding > m_databaseBinding
The Databases where the Bot will be spatialized.
Definition: bot.h:138
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
Class that aggregates most important parameters that allow to configure the PathFinding of a Bot...
Definition: pathfinderconfig.h:19
Class used to provide Bot initialization parameters.
Definition: bot.h:98
The VisualDebugServer manages the sending of data to clients.
Definition: visualdebugserver.h:254
void SetNewPathNavigationProfileId(KyUInt32 navigationProfileId)
Sets the NavigationProfile that will be used in the new ComputeNewPathToDestination() and InitAStarQu...
Definition: bot.inl:57
#define KY_DEPRECATED(f)
Macro to mark a function, class or method as deprecated.
Definition: types.h:289
Maintains runtime validity information on a given Path.
Definition: pathvalidityinterval.h:88
void SetLocalCostOnPathDistance(KyFloat32 localCostOnPathDistance)
Set the distance along the path from the ProgressOnPath used to compute the local maximum cost multip...
Definition: bot.inl:53
Internal representation of world elements, using a vertical cylinder shape.
Definition: spatializedcylinder.h:56
const SpatializedCylinder & GetSpatializedCylinder() const
The SpatializedCylinder used to spatialized the Bot in the bound Databases.
Definition: bot.inl:23
void SetPathFinderConfig(const PathFinderConfig &pathFinderConfig)
The Path will not be recomputed after this call. The PathFinderConfig will be used by the next Comput...
static Vec2f Zero()
Returns a vector of zero size: (0,0).
Definition: vec2f.h:154
bool IsComputingNewPath() const
Call this method each time you want to compute a new Path.
Definition: bot.inl:21
void RemoveFromDatabase()
Removes the Bot from the Database (and thus from the World).
void ClearFollowedPath()
Clears the current LivePath and associated events.
This class aggregates all necessary information to describe a position on a LivePath, namely:
Definition: positiononlivepath.h:46
Vec3f ComputeMoveOnNavMeshWithTraverseLogic(const Kaim::Vec3f &velocity, KyFloat32 simulationTimeInSeconds)
Helper function to compute the position the bot would reach if you apply the velocity for simulationT...
Definition: bot.inl:78
Each instance of this class uniquely identifies a single NavTriangle in a NavFloor.
Definition: navtriangleptr.h:22
Class that aggregates all parameters that allow to configure the PathFinding and the PathFollowing of...
Definition: botconfig.h:52
void SetSplineTrajectoryConfig(const SplineTrajectoryConfig &splineTrajectoryConfig)
The Trajectory will be recomputed the frame after this call.
KyResult InitAStarQueryForBot(Ptr< BaseAStarQuery > &astarQuery, const Vec3f &destPos)
Initialize a BaseAStarQuery that works is properly initialized for the Bot.
void SetDefaults()
Sets all members to their default value.
Definition: bot.h:115
void SetPathProgressConfig(const PathProgressConfig &pathProgressConfig)
The PathProgressConfig::m_pathValidationDistanceMinBackward and PathProgressConfig::m_pathValidationM...
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
Set of parameters used by the ShortcutTrajectory and TargetOnPathComputer classes to update Bot targe...
Definition: shortcuttrajectoryconfig.h:109
void SetTrajectoryFailureMode(TrajectoryFailureMode trajectoryFailureMode)
Set the TrajectoryFailureMode, nothing in particular will be recomputed after this call...
Definition: bot.inl:50
void Init(const BotInitConfig &initConfig)
uses a default constructed BotConfig
Vec3f ComputeMoveOnNavMesh(const Kaim::Vec3f &velocity, KyFloat32 simulationTimeInSeconds)
Helper function to compute the position the bot would reach if you apply the velocity for simulationT...
void SetVelocityAndFrontDirection(const Vec3f &velocity)
For convenience, set velocity and deduce frontDirection from it.
Definition: bot.inl:122
ManualControlStatus
Definition: manualcontrolinterval.h:18
bool HasReachedPosition(const Vec3f &position, KyFloat32 precisionRadius) const
The position is reached when the segment between a Bot previous and current position intersects the c...
This class aggregates a Path and all runtime related stuff namely the PathValidityInterval.
Definition: livepath.h:59
Each instance of this class uniquely identifies a single and mono-directionnal NavGraphEdge in a NavG...
Definition: navgraphedgeptr.h:25
void SetHeight(KyFloat32 height)
Height is only used to send the correct visualDebug.
const PositionOnPath * GetUpcomingEventPositionOnPath() const
Returns a pointer to the PositionOnPath of the PathEvent along the path after m_progressOnLivePath.
const NavTag * GetPreviousEventNavTag() const
Returns a pointer to the navTag along the path before m_progressOnLivePath.
void Clear()
Prepares this instance for destruction and / or reuse: sets all members to their default values and c...
This class computes the trajectory either with ShortcutTrajectory or with SplineTrajectory.
Definition: trajectory.h:30
The class representing a path.
Definition: path.h:42
void SetPosition(const Vec3f &position)
As Gameware Navigation never moves a bot, call this function to update the Bot position.
Definition: bot.inl:94
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
ResetTrajectoryStatus
Definition: resettrajectorystatus.h:14
void SetChannelComputerConfig(const ChannelComputerConfig &channelComputerConfig)
The path will not be recomputed after this call. The ChannelComputerConfig will be used by the next C...
const BotOutput & GetBotOutput() const
Returns the output computed during last World::Update()
Definition: bot.inl:139