gwnavruntime/pathfollower/followedcirclearcspline.h Source File

followedcirclearcspline.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 
8 #pragma once
9 
14 
15 namespace Kaim
16 {
17 
18 
19 enum SplineComputationMode
20 {
21  SplineComputation_Failure, // Spline computation failed, and Shortcut cannot reach the Path
22  SplineComputation_OutOfNavMesh, // Following or going to an out of NavMesh PathEdge since there's no Channel, relying on Shortcut, no spline computed.
23  SplineComputation_Frozen, // Spline was not recomputed but can potentially be cut
24  SplineComputation_Degraded, // Spline computation failed, so relying on Shortcut to generate a spline following the Channel
25  SplineComputation_SubOptimal, // Spline computed in channel but some constraints are respected
26  SplineComputation_Optimal, // Spline computed in channel respecting all constraints
27 };
28 
31 {
32 public:
33  FollowedCircleArcSpline() { Clear(); }
35  FollowedCircleArcSpline& operator=(const FollowedCircleArcSpline& other);
36  void Clear();
37 
38  bool IsEmpty() const { return m_spline.IsEmpty(); }
39 
40 public:
41  SplineComputationMode m_computationMode;
42 
43  // This is empty on SplineComputation_OutOfNavMesh and SplineComputation_Failure:
44  CircleArcSpline m_spline;
45  PositionOnCircleArcSpline m_positionOnSpline;
46  PositionOnCircleArcSpline m_targetOnSpline;
47  KyFloat32 m_recomputationDistance; // after having moved this distance along the spline, the spline will be recomputed, this distance is computed based on SplineComputaitonConfig::m_recomputationDistanceRatio and the length of the spline
48 
49  ChannelSectionPtr m_endSection; // end section in channel if any
50  PositionOnPath m_endPositionOnPath; // end positionOnPath of the spline or if no spline with SplineComputation_OutOfNavMesh it is used as target position
51  bool m_hasEndConstraint; // indicates if a direction associated to m_endPositionOnPath is used as an end constraint for the spline
52  Vec2f m_endConstraint; // the direction of the end constraint, relevant only if m_hasEndConstraint is true
53 };
54 
55 }
56 
This class aggregates all necessary information about a position on a Path.
Definition: positiononpath.h:29
Maintains a position moving along a given CricleArcSpline.
Definition: positiononcirclearcspline.h:60
The class representing a spline compounded of oriented circle arcs and straight line segments...
Definition: circlearcspline.h:27
2d vector using KyFloat32.
Definition: vec2f.h:18
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
CircleArcSpline with computation information and current position of follow.
Definition: followedcirclearcspline.h:30
float KyFloat32
float
Definition: types.h:32