(C++)  1.0.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
LinearlyInterpolatedCurve.hh
1 #ifndef GRAIL_LINEARLY_INTERPOLATED_CURVE_H
2 #define GRAIL_LINEARLY_INTERPOLATED_CURVE_H
3 
4 #include "Curve.hh"
5 #include "../../libs/vector2/vector2.h"
6 
7 namespace grail
8 {
9  namespace curves
10  {
11  class LinearlyInterpolatedCurve final : public Curve
12  {
13  public:
14  LinearlyInterpolatedCurve(const std::vector<Vector2>& points);
15  LinearlyInterpolatedCurve(std::vector<Vector2>&& points);
16 
17  virtual float Sample(float argument) const override;
18 
19  void SetPointY(std::size_t pointIndex, float y);
20 
21  std::vector<Vector2>& GetPoints();
22  const std::vector<Vector2>& GetPoints() const;
23 
24  CurveTypeId GetTypeId() const override;
25 
26  private:
27  std::vector<Vector2> points{};
28  };
29  }
30 }
31 
32 #endif // GRAIL_LINEARLY_INTERPOLATED_CURVE_H
The Curve class - Defines objects transforming one value into the other.
Definition: Curve.hh:17
Definition: LinearlyInterpolatedCurve.hh:12
virtual float Sample(float argument) const override
Sample - User-defined method which processes provided value (currently vector of values - multidemens...
Definition: LinearlyInterpolatedCurve.cpp:20