Loading...
Searching...
No Matches
Sensor.h File Reference
Go to the source code of this file.
Enumerations | |
| enum | sfSensorType { sfSensorAccelerometer , sfSensorGyroscope , sfSensorMagnetometer , sfSensorGravity , sfSensorUserAcceleration , sfSensorOrientation } |
| Sensor Types. More... | |
| enum | { sfSensorCount = sfSensorOrientation + 1 } |
Functions | |
| bool | sfSensor_isAvailable (sfSensorType sensor) |
| Check if a sensor is available on the underlying platform. | |
| void | sfSensor_setEnabled (sfSensorType sensor, bool enabled) |
| Enable or disable a sensor. | |
| sfVector3f | sfSensor_getValue (sfSensorType sensor) |
| Get the current sensor value. | |
Enumeration Type Documentation
◆ anonymous enum
| anonymous enum |
◆ sfSensorType
| enum sfSensorType |
Sensor Types.
Function Documentation
◆ sfSensor_getValue()
| sfVector3f sfSensor_getValue | ( | sfSensorType | sensor | ) |
Get the current sensor value.
- Parameters
-
sensor Sensor to read
- Returns
- The current sensor value
◆ sfSensor_isAvailable()
| bool sfSensor_isAvailable | ( | sfSensorType | sensor | ) |
Check if a sensor is available on the underlying platform.
- Parameters
-
sensor Sensor to check
- Returns
- true if the sensor is available, false otherwise
◆ sfSensor_setEnabled()
| void sfSensor_setEnabled | ( | sfSensorType | sensor, |
| bool | enabled ) |
Enable or disable a sensor.
All sensors are disabled by default, to avoid consuming too much battery power. Once a sensor is enabled, it starts sending events of the corresponding type.
This function does nothing if the sensor is unavailable.
- Parameters
-
sensor Sensor to enable enabled true to enable, false to disable