Overte C++ Documentation
AxisValue.h
1 //
2 // AxisValue.h
3 //
4 // Created by David Rowe on 13 Dec 2018.
5 // Copyright 2018 High Fidelity, Inc.
6 //
7 // Distributed under the Apache License, Version 2.0.
8 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
9 //
10 
11 #pragma once
12 #ifndef hifi_controllers_AxisValue_h
13 #define hifi_controllers_AxisValue_h
14 
15 #include <QtCore/qglobal.h>
16 
17 namespace controller {
18 
19  struct AxisValue {
20  public:
21  float value { 0.0f };
22  // The value can be timestamped to determine if consecutive identical values should be output (e.g., mouse movement).
23  quint64 timestamp { 0 };
24  bool valid { false };
25 
26  AxisValue() {}
27  AxisValue(const float value, const quint64 timestamp, bool valid = true);
28 
29  bool operator ==(const AxisValue& right) const;
30  bool operator !=(const AxisValue& right) const { return !(*this == right); }
31  };
32 }
33 
34 #endif // hifi_controllers_AxisValue_h