gwnavruntime/pathfollower/splinecomputationconfig.h Source File

splinecomputationconfig.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 
10 
15 
16 namespace Kaim
17 {
18 
19 class SplineComputationConfigBlob;
20 
21 class AdvancedSplineComputationConfig
22 {
24 
25 public:
26  AdvancedSplineComputationConfig() { SetDefaults(); }
27  void SetDefaults();
28 
29  bool operator==(const AdvancedSplineComputationConfig& other) const;
30  bool operator!=(const AdvancedSplineComputationConfig& other) const { return !operator==(other); }
31 
32 public:
37  KyFloat32 m_arcMinLength;
38 
48  KyFloat32 m_fullTurnTolerance;
49 };
50 
51 class SplineComputationConfig
52 {
54 
55 public:
56  SplineComputationConfig() { SetDefaults(); }
57  void SetDefaults();
58  KyResult InitFromBlob(const SplineComputationConfigBlob& blob);
59  bool operator==(const SplineComputationConfig& other) const;
60  bool operator!=(const SplineComputationConfig& other) const { return !operator==(other); }
61 
65  KyResult SetDistanceToInnerCornerFunctionPoints(const KyArray<Vec2f>& points);
66 
67  // Computes distance to inner corner for the given channelWidth, accordingly
68  // to the piecewise affine function defined by its choke points.
69  KyFloat32 GetDistanceToInnerCorner(KyFloat32 channelWidth) const;
70 
71 private:
72  // This internal method is called by main API InitFromBlob() and the KyArray<>-based
73  // functions. It actually checks points validity and sets up the function parameters.
74  KyResult SetDistanceToInnerCornerFunctionPoints(const Vec2f* points, KyUInt32 pointCount);
75 
76 
77 public:
78  RadiusProfileArray m_radiusProfileArray;
79 
86  KyFloat32 m_length;
87 
92  KyFloat32 m_startAndEndConstraintTurnMaxAngle;
93 
94  AdvancedSplineComputationConfig m_advancedConfig;
95 
96 public: // internal:
97 
98  // -------------------- Ideal distances to Channel borders --------------------
99 
114 
115  /************************************************************************************/
116  /* d : */
117  /* ^ : w from: */
118  /* | : - 0 to P0.x => linear */
119  /* | Pn : - P0.x to Pn.x => affine */
120  /* | +-------------> : - over Pn.x => constant to Pn.y */
121  /* | . : */
122  /* | P0 . : */
123  /* | ___+-----+ : */
124  /* | __--- P1 : */
125  /* 0 +----------------------------------> w : */
126  /* 0 : */
127  /************************************************************************************/
128  KyArray<Vec3f> m_distanceToInnerCornerFunctionPoints; // Vec3f::m_z represents the slope from previous point to current point x,y
129 };
130 
131 
132 } // namespace Kaim
133 
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
Navigation return code class.
Definition: types.h:108
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
float KyFloat32
float
Definition: types.h:32