草案
此页面不完整。
安全上下文
此特征只可用于
安全上下文
(HTTPS),在某些或所有
支持浏览器
.
getViewerPose()
method, a member of the
XRFrame
interface, returns a
XRViewerPose
object which describes the viewer's pose (position and orientation) relative to the specified reference space.
见
getPose()
method for a way to calculate a pose that represents the difference between two spaces.
var xrViewerPose = xrFrame.getViewerPose(referenceSpace);
referenceSpace
XRReferenceSpace
object specifying the space to use as the reference point or base for the computation of the viewer's current pose.
A
XRViewerPose
describing the viewer's position and orientation relative to the specified reference space.
InvalidStateError
DOMException
indicating that
getViewerPose()
was not called within the context of a callback to a session's
XRSession.requestAnimationFrame()
.
In this callback function for
requestAnimationFrame()
,
XRViewerPose
describing the viewer's viewpoint on the world is obtained by calling
getViewerPose()
在
XRFrame
passed into the callback.
viewerPose = xrFrame.getViewerPose(xrReferenceSpace);
if (viewerPose) {
/* render the pose's views */
}
To see a complete example, take a look at Movement, orientation, and motion .
| 规范 | 状态 | 注释 |
|---|---|---|
|
WebXR 设备 API
The definition of 'XRFrame.getViewerPose()' in that specification. |
工作草案 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
getViewerPose()
|
Chrome 79 | Edge 79 | Firefox No | IE No | Opera No | Safari No | WebView Android No | Chrome Android 79 | Firefox Android No | Opera Android No | Safari iOS No | Samsung Internet Android 11.2 |
完整支持
不支持
实验。期望将来行为有所改变。
XRFrame
getPose()
getViewerPose()
Navigator.xr
WebGLRenderingContext.makeXRCompatible()
XR
XRBoundedReferenceSpace
XRInputSource
XRInputSourceArray
XRInputSourceEvent
XRInputSourcesChangeEvent
XRPose
XRReferenceSpace
XRReferenceSpaceEvent
XRRenderState
XRRigidTransform
XRSession
XRSessionEvent
XRSpace
XRView
XRViewerPose
XRViewport
XRWebGLLayer