Sensor.hpp
1 #ifndef CPP3DS_SENSOR_HPP
2 #define CPP3DS_SENSOR_HPP
3 
4 #include <cpp3ds/System/Vector3.hpp>
5 #include <cpp3ds/System/Time.hpp>
6 
7 namespace cpp3ds {
12 class Sensor {
13 public:
14 
19  enum Type {
26 
28  };
29 
38  static bool isAvailable(Type sensor);
39 
53  static void setEnabled(Type sensor, bool enabled);
54 
63  static bool isEnabled(Type sensor);
64 
69  static void update();
70 
79  static Vector3f getValue(Type sensor);
80 
81 private:
82 
83  static bool m_accel_enabled;
84  static bool m_gyro_enabled;
85  static Vector3f m_accel;
86  static Vector3f m_gyro;
87 
88 };
89 
90 }
91 
92 
93 #endif
94 
95 
Measures the raw acceleration (m/s²)
Definition: Sensor.hpp:20
Type
Sensor type.
Definition: Sensor.hpp:19
Measures the absolute 3D orientation (degrees)
Definition: Sensor.hpp:25
static bool isAvailable(Type sensor)
Check if a sensor is available on the underlying platform.
static void update()
Update the state of all the sensors.
Give access to the real-time state of the sensors.
Definition: Sensor.hpp:12
static Vector3f getValue(Type sensor)
Get the current sensor value.
Measures the raw rotation rates (degrees/s)
Definition: Sensor.hpp:21
static void setEnabled(Type sensor, bool enabled)
Enable or disable a sensor.
static bool isEnabled(Type sensor)
Check if a sensor is enabled.
Measures the ambient magnetic field (micro-teslas)
Definition: Sensor.hpp:22
Measures the direction and intensity of device acceleration, independent of the gravity (m/s²) ...
Definition: Sensor.hpp:24
Measures the direction and intensity of gravity, independent of device acceleration (m/s²) ...
Definition: Sensor.hpp:23
Keep last – the total number of sensor types.
Definition: Sensor.hpp:27