OrientationSensor: populateMatrix() メソッド

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

OrientationSensor インターフェイスの populateMatrix メソッドは、指定の書き込み先行列に、センサーの最新の測定値に基づく回転行列を入れます。回転行列は以下のものです。

センサーの四元数を行列に変換するのに用いられる数式

ただし:

  • W = cos(θ/2)
  • X = Vx * sin(θ/2)
  • Y = Vy * sin(θ/2)
  • Z = Vz * sin(θ/2)

構文

js
populateMatrix(targetMatrix)

OrientationSensor はベースクラスなので、populateMatrix は派生クラスからのみ読み取ることができます。

引数

返値

なし (undefined)

js
// TBD

仕様書

Specification
Orientation Sensor
# orientationsensor-populatematrix

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
populateMatrix

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support