Jopnal Engine  alpha 0.4
Simple Component Based 2D/3D Game Engine
Public Types | Static Public Member Functions | List of all members
jop::Sensor Class Reference

#include <Sensor.hpp>

Public Types

enum  Type {
  Type::Accelerometer, Type::Gyroscope, Type::Magnetometer, Type::Gravity,
  Type::LinearAcceleration, Type::Orientation, Type::__Count
}
 

Static Public Member Functions

static bool isAvailable (const Type type)
 Check if a sensor is available. More...
 
static bool isEnabled (const Type type)
 Check if a sensor is currently enabled. More...
 
static void setEnabled (const Type type, const bool enabled)
 Set a sensor enabled. More...
 
static glm::vec3 getData (const Type type)
 Get data from a sensor. More...
 

Detailed Description

Definition at line 34 of file Sensor.hpp.

Member Enumeration Documentation

enum jop::Sensor::Type
strong
Enumerator
Accelerometer 

Measures the raw acceleration (meter/second^2)

Gyroscope 

Measures the raw rotation rates (degrees/second)

Magnetometer 

Measures the ambient magnetic field (micro-teslas)

Gravity 

Measures the direction and intensity of gravity, independent of device acceleration (meter/second^2)

LinearAcceleration 

Measures the direction and intensity of device acceleration, independent of the gravity (meter/second^2)

Orientation 

Measures the absolute 3D orientation (degrees)

__Count 

For internal functionality, do not use.

Definition at line 38 of file Sensor.hpp.

Member Function Documentation

static glm::vec3 jop::Sensor::getData ( const Type  type)
static

Get data from a sensor.

Parameters
typeThe sensor type
Returns
The sensor data, as a 3-dimensional vector
static bool jop::Sensor::isAvailable ( const Type  type)
static

Check if a sensor is available.

Parameters
typeThe sensor type
Returns
True if the sensor is available and usable
static bool jop::Sensor::isEnabled ( const Type  type)
static

Check if a sensor is currently enabled.

Parameters
typeThe sensor type
Returns
True if the sensor is currently enabled
static void jop::Sensor::setEnabled ( const Type  type,
const bool  enabled 
)
static

Set a sensor enabled.

Parameters
typeThe sensor type
enabledTrue to enable, false to disable. For all sensors, the default state is disabled

The documentation for this class was generated from the following file: