8 #ifndef Navigation_BaseShortcutTrajectory_H
9 #define Navigation_BaseShortcutTrajectory_H
19 class VisualDebugServer;
24 enum ShortcutTrajectoryComputeMode
26 ShortcutMode_MustUpdateTargetOnPath,
27 ShortcutMode_UseCurrentTargetOnPath,
28 ShortcutMode_SnapOnPath,
36 class BaseShortcutTrajectory :
public RefCountBase<BaseShortcutTrajectory, MemStat_PathFollowing>
43 : m_trajectory(trajectory)
44 , m_useTargetProvidedByUser(
false)
45 , m_target(0.0f, 0.0f, 0.0f)
47 , m_trajectoryComputeMode(ShortcutMode_MustUpdateTargetOnPath)
48 , m_useMinimalTargetUpdate(
false)
49 , m_visualDebugBlobSent(
false)
54 void Compute(
KyFloat32 simulationTimeInSeconds);
56 void ClearTrajectory();
58 const Vec3f& GetTrajectoryTarget()
const {
return m_target; }
60 void ForceTargetToTargetOnPath();
61 void ForceTargetToPosition(
const Vec3f& forcedTarget);
66 void SendVisualDebugBlob(
VisualDebugServer& visualDebugServer, VisualDebugSendChangeEvent changeEvent);
67 void RemoveAllVisualDebugBeforeTrajectoryChange(
VisualDebugServer& visualDebugServer);
69 void UpdateTarget(
KyFloat32 simulationTimeInSeconds);
70 void InitTargetOnPathIfNeeded();
71 void UpdateTrajectoryComputeMode();
72 ShortcutTrajectoryComputeMode GetComputeModeToApply()
const;
73 bool CanUseTargetOnPath()
const;
74 void ComputeStraightTrajectory(
KyFloat32 simulationTimeInSeconds);
75 void ComputeAvoidanceTrajectory(
KyFloat32 simulationTimeInSeconds);
76 void ComputeSnapOnPathTrajectory(
KyFloat32 simulationTimeInSeconds);
80 virtual bool IsShortcutTrajectoryAllowingToSkipPathFollowingThisFrame(
KyFloat32& simulationTimeInSeconds) = 0;
83 virtual KyResult ComputeTargetOnPathOnNavMeshOnly(TargetOnPath& targetOnPath,
KyFloat32 simulationTimeInSeconds, ComputeTargetOnPathSearchControl forwardSearchControl)
const = 0;
88 Ptr<IAvoidanceComputer> m_avoidanceComputer;
89 TargetOnPath m_targetOnPath;
90 bool m_useTargetProvidedByUser;
93 ShortcutTrajectoryComputeMode m_trajectoryComputeMode;
94 bool m_useMinimalTargetUpdate;
96 bool m_visualDebugBlobSent;
103 #endif // Navigation_Trajectory_H
This class is the world element that represent an active character in Gameware Navigation.
Definition: bot.h:150
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
This class computes minimal trajectory made of just one velocity.
Definition: baseshortcuttrajectory.h:37
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:387
Definition: gamekitcrowddispersion.h:20
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
The VisualDebugServer manages the sending of data to clients.
Definition: visualdebugserver.h:254
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
This class computes the trajectory either with ShortcutTrajectory or with SplineTrajectory.
Definition: trajectory.h:30
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