LinearAccelerationSensor: LinearAccelerationSensor() コンストラクター
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
LinearAccelerationSensor() コンストラクターは、デバイスの 3 軸それぞれにかかっている加速度の測定値を、重力の影響を除いて提供する新しい LinearAccelerationSensor オブジェクトを生成します。
構文
js
new LinearAccelerationSensor()
new LinearAccelerationSensor(options)
引数
options省略可-
以下のオプションがあります。
frequency-
1 秒間にサンプルを何回取得したいかであり、
readingイベントが呼ばれる 1 秒あたりの回数になります。整数または小数が使用でき、小数は 1 秒に 1 回未満の頻度を設定するのに用います。実際の取得頻度はデバイスハードウェアに依存するので、要求値より少なくなる可能性があります。 referenceFrame-
'device'または'screen'です。デフォルトは'device'です。
例外
SecurityErrorDOMException-
この機能の使用が 権限ポリシー によりブロックされました。
仕様書
| Specification |
|---|
| Accelerometer> # dom-linearaccelerationsensor-linearaccelerationsensor> |
ブラウザーの互換性
関連情報
readingイベント