gwnavruntime/pathfollower/basepathprogresscomputer.h Source File

basepathprogresscomputer.h
Go to the documentation of this file.
1 /*
2 * Copyright 2016 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 #pragma once
8 
12 
13 
14 namespace Kaim
15 {
16 
17 class Bot;
18 class IPathEventListObserver;
19 class IPositionOnPathValidator;
20 class PathEvent;
21 class PositionOnLivePath;
22 
30 class BasePathProgressComputer: public RefCountBase<BasePathProgressComputer, MemStat_PathFollowing>
31 {
33 
34 public:
35  // ------------------------------ Functions -----------------------------
37  virtual ~BasePathProgressComputer();
38 
40  void SetPathEventListObserver(const Ptr<IPathEventListObserver>& m_pathEventListObserver);
41  Ptr<IPathEventListObserver> GetPathEventListObserver() { return m_pathEventListObserver; }
42 
44  void SetPositionOnPathCheckPointValidator(const Ptr<IPositionOnPathValidator>& positionOnPathCheckPointValidator);
45  Ptr<IPositionOnPathValidator> GetPositionOnPathCheckPointValidator() { return m_positionOnPathCheckPointValidator; }
46 
47 
48  // ---------------------------------- Pure Virtual Functions ----------------------------------
49  virtual void Update(Bot* bot, KyFloat32 simulationTimeInSeconds) = 0;
50 
51 protected:
52  void ComputeProgressOnPath(Bot* bot);
53  bool MustEventBeValidated(Bot* bot, const PathEvent& pathEvent);
54  void FindUpperLimitOnPath(Bot* bot, PositionOnLivePath& positionOnPath);
55  void StopProgressAtUpperLimitOnPath(Bot* bot, const PositionOnLivePath& upperLimitOnPath);
56  bool CanProgressAfterEvent(Bot* bot); // called by ComputeProgressOnPath
57  void UpdateProgressOnPathStatus(Bot* bot); // called by ComputeProgressOnPath
58  void MoveForwardAfterCrossedBisectorPlanes(Bot* bot, const PositionOnLivePath& upperLimitOnPath); // called by ComputeProgressOnPath, should not be called if at upperBound or lastPathNode
59  void SnapProgressToNodeOrEvent(Bot* bot);
60 
61  void ComputePositionInChannel(Bot* bot);
62 
63 protected:
64  Ptr<IPathEventListObserver> m_pathEventListObserver;
65  Ptr<IPositionOnPathValidator> m_positionOnPathCheckPointValidator;
66 };
67 
68 
69 } // namespace Kaim
70 
void SetPathEventListObserver(const Ptr< IPathEventListObserver > &m_pathEventListObserver)
Sets the SetPathEventListObserver.
Definition: basepathprogresscomputer.cpp:19
This class is the world element that represent an active character in Autodesk Navigation.
Definition: bot.h:128
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:196
A PathEvent is a particular PositionOnPath which feature is specified by a PathEventType.
Definition: patheventlist.h:59
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
The abstract base class for PathProgressComputer classes.
Definition: basepathprogresscomputer.h:30
void SetPositionOnPathCheckPointValidator(const Ptr< IPositionOnPathValidator > &positionOnPathCheckPointValidator)
Sets the IPositionOnPathValidator to be used to validate target on path check points.
Definition: basepathprogresscomputer.cpp:24
This class aggregates all necessary information to describe a position on a LivePath, namely:
Definition: positiononlivepath.h:43
float KyFloat32
float
Definition: types.h:32