gwnavruntime/pathfollower/followedcirclearcspline.h Source File

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