OrientationSensor: populateMatrix() メソッド

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

ブラウザーの互換性

BCD tables only load in the browser