Supporting Nodes
This is a comprehensive list of additional blueprint nodes offered by this plugin. These functions are not part of the default Sensors API; they are provided for your convenience.
In the Sensors API, all Sensor Events generated by the Sensor Listener contain an array of floats to report their respective sensor values. This mirrors how the Sensors API exposes these values, which can make the mapping between specific values in the array and their corresponding sensors more complex. The functions listed below are designed to simplify this mapping process, ensuring a more streamlined experience for you.
All utility functions below accept only one parameter; the float array of values produced by the Sensor Listener's "On Sensor Value Changed" delegate.
Get Temperature
Produces a single float representing the ambient air temperature measured in °C. This node corresponds to the AMBIENT_TEMPERATURE sensor.
Get Light
Produces a single float representing the illuminance measured in lx. This node corresponds to the LIGHT sensor.
Get Pressure
Produces a single float representing the ambient air pressure measured in hPa or mbar. This node corresponds to the PRESSURE sensor.
Get Humidity
Produces a single float representing the ambient relative humidity measured in %. This node corresponds to the RELATIVE_HUMIDITY sensor.
Get Game Rotation
Produces an FVector with the rotation around the corresponding axis (sin(θ/2)). This node corresponds to the GAME_ROTATION_VECTOR sensor.
Get Device Orientation
Additional supporting node which uses the SDK's getRotationMatrix and getOrientation functions as well as Unreal Engine's FQuat for use with SetRotation for smooth rotations. This node corresponds to the GAME_ROTATION_VECTOR sensor.
Get Accelerometer
Produces an FVector with the acceleration force along the corresponding axis (including gravity) measured in m/s2. This node corresponds to the ACCELEROMETER sensor.
Get Accelerometer Uncalibrated
Produces two FVector instances: the first representing raw acceleration forces, and the second incorporating estimated bias compensation for each axis, including gravity, measured in m/s2 This is represented by the FAccelerometerUncalibrated struct. This node corresponds to the ACCELEROMETER_UNCALIBRATED sensor.
Get Gravity
Produces an FVector representing the force of gravity along the corresponding axis, measured in m/s2. This node corresponds to the GRAVITY sensor.
Get Gyroscope
Produces an FVector representing the rate of rotation around the corresponding axis, measured in rad/s. This node corresponds to the GYROSCOPE sensor.
Get Gyroscope Uncalibrated
Produces two FVector instances: the first representing the rate of rotation without drift compensation, and the second representing the estimated drift, around the corresponding axis, measured in rad/s. This is represented by the FGyroscopeUncalibrated struct. This node corresponds to the GYROSCOPE_UNCALIBRATED sensor.
Get Linear Acceleration
Produces an FVector representing the acceleration force along the corresponding axis (excluding gravity), measured in m/s2. This node corresponds to the LINEAR_ACCELERATION sensor.
Get Rotation Vector
Produces an FVector with the rotation around the corresponding axis (sin(θ/2)) as well as an optional scalar component of the vector (cos(θ/2)). This is represented by the FSensorRotationVector struct. This node corresponds to the ROTATION_VECTOR sensor.
Get Step Count
Produces a float representing the number of steps taken by the user since the last reboot while the sensor was activated, measured in steps. This node corresponds to the STEP_COUNTER sensor.
Get Geomagnetic Rotation
Produces an FVector with the geomagentic rotation around the corresponding axis (sin(θ/2)). This node corresponds to the GEOMAGNETIC_ROTATION_VECTOR sensor.
Get Magnetic Field
Produces an FVector with the geomagentic field strength along the corresponding axis, measured in μT This node corresponds to the MAGNETIC_FIELD sensor.
Get Magnetic Field Uncalibrated
Produces two FVector instances: the first representing the gemoagnetic field strength without hard iron calibration, and the second representing iron bias estimation, along the corresponding axis, measured in μT. This is represented by the FMagneticFieldUncalibrated struct. This node corresponds to the MAGNETIC_FIELD_UNCALIBRATED sensor.
Get Proxmity
Produces a float representing the distance from and object, measured in cm. Some proxmity sensors provide only binary values representing near and far. This node corresponds to the PROXIMITY sensor.
Get True North Device Orientation
Produces a FRotator representing the rotation in real world space towards magnetic north. This node corresponds to the ACCELEROMETER and MAGNETIC_FIELD sensor.
Because this node requires two sensor readings, we have provided an example below to assist you in one way you can make use of it. It is recommended that you first take a look at The Example Setup documentation first to get a basic understanding on how to make use of this plugin, otherwise the below example may be overwhelming.
NOTE: Depending on your applications orientation (portrait or landscape) you may want to swap the pitch and roll values.
Example
You must check the device has and then activate the ACCELEROMETER and MAGNETIC_FIELD sensors.
In the above example, you can see we save both the sensor values when they change. Then, when a value has been updated, we then calculate the latest orientation and save it for use.
Becuase we are making use of a rather noisy sensor (MAGNETIC_FIELD), we need to keep track of when this sensor is no longer accurate and would need recalibration.