gwnavruntime/pathfollower/splinecomputationconfig.h Source File

splinecomputationconfig.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 // primary contact: LAPA - secondary contact: MUBI
8 #ifndef Navigation_SplineConfig_H
9 #define Navigation_SplineConfig_H
10 
12 
17 
18 
19 namespace Kaim
20 {
21 
22 class SplineComputationConfigBlob;
23 
24 class AdvancedSplineComputationConfig
25 {
27 
28 public:
29  AdvancedSplineComputationConfig() { SetDefaults(); }
30  void SetDefaults();
31 
32  bool operator==(const AdvancedSplineComputationConfig& other) const;
33  bool operator!=(const AdvancedSplineComputationConfig& other) const { return !operator==(other); }
34 
35 public:
40  KyFloat32 m_arcMinLength;
41 
51  KyFloat32 m_fullTurnTolerance;
52 };
53 
54 class SplineComputationConfig
55 {
57 
58 public:
59  SplineComputationConfig() { SetDefaults(); }
60  void SetDefaults();
61  KyResult InitFromBlob(const SplineComputationConfigBlob& blob);
62  bool operator==(const SplineComputationConfig& other) const;
63  bool operator!=(const SplineComputationConfig& other) const { return !operator==(other); }
64 
68  KyResult SetDistanceToInnerCornerFunctionPoints(const KyArray<Vec2f>& points);
69 
70  // Computes distance to inner corner for the given channelWidth, accordingly
71  // to the piecewise affine function defined by its choke points.
72  KyFloat32 GetDistanceToInnerCorner(KyFloat32 channelWidth) const;
73 
74 private:
75  // This internal method is called by main API InitFromBlob() and the KyArray<>-based
76  // functions. It actually checks points validity and sets up the function parameters.
77  KyResult SetDistanceToInnerCornerFunctionPoints(const Vec2f* points, KyUInt32 pointCount);
78 
79 
80 public:
81  RadiusProfileArray m_radiusProfileArray;
82 
89  KyFloat32 m_length;
90 
95  KyFloat32 m_startAndEndConstraintTurnMaxAngle;
96 
97  AdvancedSplineComputationConfig m_advancedConfig;
98 
99 public: // Internal:
100 
101  // -------------------- Ideal distances to Channel borders --------------------
102 
117 
118  /************************************************************************************/
119  /* d : */
120  /* ^ : w from: */
121  /* | : - 0 to P0.x => linear */
122  /* | Pn : - P0.x to Pn.x => affine */
123  /* | +-------------> : - over Pn.x => constant to Pn.y */
124  /* | . : */
125  /* | P0 . : */
126  /* | ___+-----+ : */
127  /* | __--- P1 : */
128  /* 0 +----------------------------------> w : */
129  /* 0 : */
130  /************************************************************************************/
131  KyArray<Vec3f> m_distanceToInnerCornerFunctionPoints; // Vec3f::m_z represents the slope from previous point to current point x,y
132 };
133 
134 
135 } // namespace Kaim
136 
137 #endif // Navigation_SplineConfig_H
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
Definition: gamekitcrowddispersion.h:20
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43