弃用
This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the
兼容性表格
at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
resetPose()
方法在
VRDisplay
interface resets the pose for the
VRDisplay
, treating its current
VRPose.position
and
VRPose.orientation
as the "origin/zero" values.
后于
resetPost()
has been called, future poses returned from
VRDisplay.getPose()
/
VRDisplay.getImmediatePose()
will describe positions relative to the
VRDisplay
's position when
resetPose()
was last called and will treat the display’s yaw when
resetPose()
was last called as the forward orientation.
The VRDisplay's reported roll and pitch do not change when
resetPose()
is called as they are relative to gravity. Calling
resetPose()
may change the
VRStageParameters.sittingToStandingTransform
matrix.
vrDisplayInstance.resetPose();
None.
Void.
// Assuming vrDisplay already contains a VRDisplay object,
// and we have a <button> referenced inside btn
btn.addEventListener('click', function() {
vrDisplay.resetPose();
console.log('Current pose set as origin/center');
});
| 规范 | 状态 | 注释 |
|---|---|---|
|
WebVR 1.1
The definition of 'resetPose()' in that specification. |
草案 | 初始定义 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
resetPose
弃用
|
Chrome No | Edge 15 — 79 |
Firefox
55
|
IE No | Opera ? | Safari No | WebView Android No |
Chrome Android
56 — 80
Disabled
|
Firefox Android 55 | Opera Android ? | Safari iOS ? |
Samsung Internet Android
6.0
|
完整支持
不支持
兼容性未知
实验。期望将来行为有所改变。
弃用。不要用于新网站。
见实现注意事项。
用户必须明确启用此特征。