Overte C++ Documentation
PulseFilter.h
1 //
2 // Created by Bradley Austin Davis 2015/10/25
3 // Copyright 2015 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 #pragma once
10 #ifndef hifi_Controllers_Filters_Pulse_h
11 #define hifi_Controllers_Filters_Pulse_h
12 
13 #include "../Filter.h"
14 
15 namespace controller {
16 
17 
18 class PulseFilter : public Filter {
19  REGISTER_FILTER_CLASS(PulseFilter);
20 public:
21  PulseFilter() = default;
22  PulseFilter(float interval) : _interval(interval) {}
23 
24  virtual AxisValue apply(AxisValue value) const override;
25 
26  virtual Pose apply(Pose value) const override { return value; }
27 
28  virtual bool parseParameters(const QJsonValue& parameters) override;
29 
30 private:
31  static const float DEFAULT_LAST_EMIT_TIME;
32  mutable float _lastEmitTime { DEFAULT_LAST_EMIT_TIME };
33  bool _resetOnZero { false };
34  float _interval { 1.0f };
35 };
36 
37 }
38 
39 #endif