XRFrame - Web APIs 编辑
Secure context
This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
Draft
This page is not complete.
A WebXR Device API XRFrame
object is passed into the requestAnimationFrame()
callback function and provides access to the information needed in order to render a single frame of animation for an XRSession
describing a VR or AR sccene. Events which communicate the tracking state of objects also provide an XRFrame
reference as part of their structure.
In addition to providing a reference to the XRSession
for which this frame is to be rendered, the getViewerPose()
method is provided to obtain the XRViewerPose
describing the viewer's position and orientation in space, and getPose()
can be used to create an XRPose
describing the relative position of one XRSpace
relative to another.
Properties
session
Read only- The
XRSession
that for which thisXRFrame
describes the tracking details for all objects. The information about a specific object can be obtained by calling one of the methods on the object.
Methods
getPose()
- Returns an
XRPose
object representing the spatial relationship between the two specifiedXRSpace
objects. getViewerPose()
- Returns an
XRViewerPose
describing the viewer's position and orientation in a givenXRReferenceSpace
.
Specifications
Specification | Status | Comment |
---|---|---|
WebXR Device API The definition of 'XRFrame' in that specification. | Working Draft | Initial definition. |
Browser compatibility
BCD tables only load in the browser
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论