OrientationSensor Class

An orientation sensor (https://w3c.github.io/orientation-sensor/#orientationsensor-interface): the orientation of the device, as a unit quaternion. The base of AbsoluteOrientationSensor and RelativeOrientationSensor.

public abstract class OrientationSensor : Sensor
Inheritance
Sensor OrientationSensor

Properties

NameDescription
QuaternionGets the components (x, y, z, w) of the unit quaternion of the orientation of the device, or null. It is the same list while the reading does not change.

Gets the components (x, y, z, w) of the unit quaternion of the orientation of the device, or null. It is the same list while the reading does not change.

public IReadOnlyList<double>? Quaternion { get; }

Methods

NameDescription
PopulateMatrix(object?)Writes the rotation matrix of the orientation of the device to a matrix (https://w3c.github.io/orientation-sensor/#dom-orientationsensor-populatematrix): a Float32Array or a Float64Array of at least 16 elements (a Single or Double array from .NET), or a DomMatrix. Throws a TypeErrorException when the array is too short, and a NotReadableError DomException when the sensor has no reading.

PopulateMatrix(object?)

MotionSensors.cs

Writes the rotation matrix of the orientation of the device to a matrix (https://w3c.github.io/orientation-sensor/#dom-orientationsensor-populatematrix): a Float32Array or a Float64Array of at least 16 elements (a Single or Double array from .NET), or a DomMatrix. Throws a TypeErrorException when the array is too short, and a NotReadableError DomException when the sensor has no reading.

public void PopulateMatrix(object? targetMatrix)

Parameters

targetMatrix object?
The matrix to fill, in column-major order.

See also