Table of Contents

Class OrientationSensor

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The OrientationSensor interface of the Sensor APIs is the base class for orientation sensors. This interface cannot be used directly. Instead it provides properties and methods accessed by interfaces that inherit from it.

[Value("OrientationSensor")]
public class OrientationSensor : Sensor
Inheritance
OrientationSensor
Derived
Inherited Members

Remarks

This feature may be blocked by a Permissions Policy set on your server.

See also on MDN

Constructors

OrientationSensor()

public OrientationSensor()

Properties

Quaternion

The quaternion read-only
property of the OrientationSensor interface returns a four element
'Array' whose elements contain the components of the unit
quaternion representing the device's orientation.

[Value("quaternion")]
public Number[]? Quaternion { get; }

Property Value

Number[]

An 'Array' whose values are the x, y, z, and w components of the quaternion
representing the device orientation.

Remarks

Because 'OrientationSensor' is a base class, quaternion may
only be read from one of its derived classes.

See also on MDN

Methods

PopulateMatrix(Union121)

The populateMatrix() method of the
OrientationSensor interface populates the given target matrix with the
rotation matrix based on the latest sensor reading. The rotation matrix is shown
below.

[Value("populateMatrix")]
public GlobalObject.Undefined PopulateMatrix(Union121 targetMatrix)

Parameters

targetMatrix Union121

Returns

GlobalObject.Undefined

None (GlobalObject.Undefined).

Remarks