From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/api/vrdisplay/index.html | 136 +++++++++++++++++++++ .../api/vrdisplay/requestanimationframe/index.html | 109 +++++++++++++++++ 2 files changed, 245 insertions(+) create mode 100644 files/zh-cn/web/api/vrdisplay/index.html create mode 100644 files/zh-cn/web/api/vrdisplay/requestanimationframe/index.html (limited to 'files/zh-cn/web/api/vrdisplay') diff --git a/files/zh-cn/web/api/vrdisplay/index.html b/files/zh-cn/web/api/vrdisplay/index.html new file mode 100644 index 0000000000..60f52c60cf --- /dev/null +++ b/files/zh-cn/web/api/vrdisplay/index.html @@ -0,0 +1,136 @@ +--- +title: VRDisplay +slug: Web/API/VRDisplay +translation_of: Web/API/VRDisplay +--- +
{{APIRef("WebVR API")}}{{SeeCompatTable}}
+ +

WebVR API 中的 VRDisplay 代表任何支持此 API 的 VR 设备。它包括了设备 ID、描述信息等诸如此类的通用信息,以及用于开始呈现 VR 场景、检索眼睛参数和显示能力以及其他重要的功能和方法。

+ +

可以通过调用 {{domxref("Navigator.getVRDisplays()")}} 方法得到所有连接的 VR 设备数组。

+ +

属性

+ +
+
{{domxref("VRDisplay.capabilities")}} {{readonlyInline}}
+
返回一个 {{domxref("VRDisplayCapabilities")}} 对象,用于指示 VRDisplay 的各种功能。
+
{{domxref("VRDisplay.depthFar")}}
+
获取或设置眼睛可视锥的最远深度。
+
{{domxref("VRDisplay.depthNear")}}
+
获取或设置眼睛可视锥的最近深度。
+
{{domxref("VRDisplay.displayId")}} {{readonlyInline}}
+
返回此 VRDisplay 的标识符,它也用作与 Gamepad API 的关联(详见 {{domxref("Gamepad.displayId")}})。
+
{{domxref("VRDisplay.displayName")}} {{readonlyInline}}
+
返回一个不反人类的名称来标识此 VRDisplay。
+
{{domxref("VRDisplay.isConnected")}} {{readonlyInline}}
+
返回一个 {{domxref("Boolean")}} 值,指示 VRDisplay 是否连接到计算机。
+
{{domxref("VRDisplay.isPresenting")}} {{readonlyInline}}
+
返回一个 {{domxref("Boolean")}} 值,指示 VRDisplay 当前是否由内容被呈现。
+
{{domxref("VRDisplay.stageParameters")}} {{readonlyInline}}
+
如果 VR 设备支持房间规模测验,则返回一个包含房间尺寸参数的 {{domxref("VRStageParameters")}} 对象。
+
+ +

方法

+ +
+
{{domxref("VRDisplay.getEyeParameters()")}}
+
返回指定一侧眼睛参数的 {{domxref("VREyeParameters")}} 对象。
+
{{domxref("VRDisplay.getLayers()")}}
+
返回 VRDisplay 当前显示的图层。
+
{{domxref("VRDisplay.getPose()")}}
+
Returns a {{domxref("VRPose")}} object defining the future predicted pose of the VRDisplay as it will be when the current frame is actually presented.
+
{{domxref("VRDisplay.getImmediatePose()")}}
+
Returns a {{domxref("VRPose")}} object defining the current pose of the VRDisplay, with no prediction applied.
+
{{domxref("VRDisplay.resetPose()")}}
+
Resets the pose for this VRDisplay, treating its current {{domxref("VRPose.position")}} and {{domxref("VRPose.orientation")}} as the "origin/zero" values.
+
{{domxref("VRDisplay.cancelAnimationFrame()")}}
+
A special implementation of {{domxref("Window.cancelAnimationFrame")}} that allows callbacks registered with {{domxref("VRDisplay.requestAnimationFrame()")}} to be unregistered.
+
{{domxref("VRDisplay.requestAnimationFrame()")}}
+
A special implementation of {{domxref("Window.requestAnimationFrame")}} containing a callback function that will be called every time a new frame of the VRDisplay presentation is rendered.
+
{{domxref("VRDisplay.requestPresent()")}}
+
Starts the VRDisplay presenting a scene.
+
{{domxref("VRDisplay.exitPresent()")}}
+
Stops the VRDisplay presenting a scene.
+
{{domxref("VRDisplay.submitFrame()")}}
+
Captures the current state of the {{domxref("VRLayer")}} currently being presented and displays it on the VRDisplay.
+
+ +

示例

+ +
TBD.
+ +

规范

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('WebVR', '#interface-vrdisplay', 'VRDisplay')}}{{Spec2('WebVR')}}Initial definition
+ +

浏览器兼容性

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatNo}}{{CompatNo}}{{CompatNo}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidFirefox Mobile (Gecko)IE PhoneOpera MobileSafari MobileChrome for Android
Basic support{{CompatNo}}{{CompatVersionUnknown}}{{CompatNo}}{{CompatNo}}{{CompatNo}}{{CompatNo}}
+
+ +

另请参见

+ + diff --git a/files/zh-cn/web/api/vrdisplay/requestanimationframe/index.html b/files/zh-cn/web/api/vrdisplay/requestanimationframe/index.html new file mode 100644 index 0000000000..31d04f4956 --- /dev/null +++ b/files/zh-cn/web/api/vrdisplay/requestanimationframe/index.html @@ -0,0 +1,109 @@ +--- +title: VRDisplay.requestAnimationFrame() +slug: Web/API/VRDisplay/requestAnimationFrame +translation_of: Web/API/VRDisplay/requestAnimationFrame +--- +
{{APIRef("WebVR API")}}{{SeeCompatTable}}
+ +

The requestAnimationFrame() method of the {{domxref("VRDisplay")}} interface is a special implementation of {{domxref("Window.requestAnimationFrame")}} containing a callback function that will be called every time a new frame of the VRDisplay presentation is rendered:

+ + + +

Syntax

+ +
var handle = vrDisplayInstance.requestAnimationFrame(callback);
+
+ +

Parameters

+ +
+
callback
+
A callback function that will be called every time a new frame of the VRDisplay presentation is rendered.
+
+ +

Return value

+ +

A long representing the handle of the requestAnimationFrame() call. This can then be passed to a {{domxref("VRDisplay.cancelAnimationFrame()")}} call to unregister the callback.

+ +

Examples

+ +
TBD.
+ +

Specifications

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('WebVR', '#dom-vrdisplay-requestanimationframe', 'requestAnimationFrame()')}}{{Spec2('WebVR')}}Initial definition
+ +

Browser compatibility

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatNo}}{{CompatNo}}{{CompatNo}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidFirefox Mobile (Gecko)IE PhoneOpera MobileSafari MobileChrome for Android
Basic support{{CompatNo}}{{CompatVersionUnknown}}{{CompatNo}}{{CompatNo}}{{CompatNo}}{{CompatNo}}
+
+ +

See also

+ + -- cgit v1.2.3-54-g00ecf