-
Notifications
You must be signed in to change notification settings - Fork 8k
/
index.md
60 lines (41 loc) · 2.53 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
title: VRPose.angularVelocity
slug: Web/API/VRPose/angularVelocity
l10n:
sourceCommit: f7dae62645a2c735ed6f6ed63f664bf279fdfc4b
---
{{APIRef("WebVR API")}}{{Deprecated_Header}}{{Non-standard_Header}}
**`angularVelocity`** は {{domxref("VRPose")}} インターフェイスの読み取り専用プロパティで、現在の {{domxref("VRPose.timestamp")}} における {{domxref("VRDisplay")}} の角速度ベクトルを表す配列を、ラジアン/秒単位で返します。
> [!NOTE]
> このプロパティは古い [WebVR API](https://immersive-web.github.io/webvr/spec/1.1/) の一部でした。これは [WebXR 機器 API](https://immersive-web.github.io/webxr/) に置き換えられました。
言い換えれば、センサーが `x`、`y`、`z` 軸を中心に回転したときの現在の速度です。
## 値
{{jsxref("Float32Array")}} です。または、 VR センサーが角速度情報を提供できない場合は `null` になります。
## 例
```js
// rendering loop for a VR scene
function drawVRScene() {
// WebVR: Request the next frame of the animation
vrSceneFrame = vrDisplay.requestAnimationFrame(drawVRScene);
// Populate frameData with the data of the next frame to display
vrDisplay.getFrameData(frameData);
// Retrieve the angular velocity values for use in rendering
// curFramePose is a VRPose object
const curFramePose = frameData.pose;
const angVel = curFramePose.angularVelocity;
const avx = angVel[0];
const avy = angVel[1];
const avz = angVel[2];
// render the scene
// …
// WebVR: submit the rendered frame to the VR display
vrDisplay.submitFrame();
}
```
## 仕様書
このプロパティは古い [WebVR API](https://immersive-web.github.io/webvr/spec/1.1/) の一部であり、これは [WebXR 機器 API](https://immersive-web.github.io/webxr/) で置き枯れられました。標準規格になる見込みはありません。
すべてのブラウザーが新しい [WebXR API](/ja/docs/Web/API/WebXR_Device_API/Fundamentals) を実装するまで、 [A-Frame](https://aframe.io/)、[Babylon.js](https://www.babylonjs.com/)、[Three.js](https://threejs.org/) などのフレームワークを使用するか、[ポリフィル](https://github.com/immersive-web/webxr-polyfill)を使用することが、すべてのブラウザーで動作する WebXR アプリを開発する上で推奨されます。[\[1\]](https://developer.oculus.com/documentation/web/port-vr-xr/)
## ブラウザーの互換性
{{Compat}}
## 関連情報
- [WebVR API](/ja/docs/Web/API/WebVR_API)