Overte C++ Documentation
LowVelocityFilter.h
1 //
2 // Created by Dante Ruiz 2017/05/15
3 // Copyright 2017 High Fidelity, Inc.
4 //
5 // Distributed under the Apache License, Version 2.0.
6 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
7 //
8 
9 #ifndef hifi_Controllers_Filters_Low_Velocity_h
10 #define hifi_Controllers_Filters_Low_Velocity_h
11 
12 #include "../Filter.h"
13 
14 namespace controller {
15 
16  class LowVelocityFilter : public Filter {
17  REGISTER_FILTER_CLASS(LowVelocityFilter);
18 
19  public:
20  LowVelocityFilter() = default;
21  LowVelocityFilter(float rotationConstant, float translationConstant) :
22  _translationConstant(translationConstant), _rotationConstant(rotationConstant) {}
23 
24  AxisValue apply(AxisValue value) const override { return value; }
25  Pose apply(Pose newPose) const override;
26  bool parseParameters(const QJsonValue& parameters) override;
27 
28  private:
29  float _translationConstant { 0.1f };
30  float _rotationConstant { 0.1f };
31  mutable Pose _oldPose { Pose() };
32  };
33 
34 }
35 
36 #endif