草案
此页面不完整。
WebXR 设备 API
dictionary
XRSessionInit
specifies required and/or optional features when requesting a new
XRSession
通过调用
navigator.xr.requestSession()
方法。
The following parameters are all optional. If none are included, the device will use a default feature configuration for all options.
optionalFeatures
可选
XRSession
may optionally support. At this time, all features are identified using strings from the
XRReferenceSpaceType
enumeration, but future updates to the WebXR standard may add more features.
requiredFeatures
可选
XRSession
must
support. These values currently must come from the enumerated type
XRReferenceSpaceType
. More features may be added in future updates to the WebXR standard.
All immersive (both
immersive-vr
and
immersive-ar
) sessions support both the
viewer
and
local
reference spaces.
Because immersive sessions are required to support the
local
reference space, any request to open an immersive
XRSession
is required to obtain
explicit or implicit user consent
.
所有
inline
WebXR sessions support the
viewer
reference space.
Each reference space or feature type has minimum safety requirements. By session type, those are:
| Reference space type | User consent rquirement | Feature policy requirement |
|---|---|---|
bounded-floor
|
Always required |
xr-spatial-tracking
|
local
|
Always required for inline sessions |
xr-spatial-tracking
|
local-floor
|
Always required |
xr-spatial-tracking
|
unbounded
|
Always required |
xr-spatial-tracking
|
viewer
|
Always required | — |
XRSessionInit
Navigator.xr
WebGLRenderingContext.makeXRCompatible()
XR
XRBoundedReferenceSpace
XRFrame
XRInputSource
XRInputSourceArray
XRInputSourceEvent
XRInputSourcesChangeEvent
XRPose
XRReferenceSpace
XRReferenceSpaceEvent
XRRenderState
XRRigidTransform
XRSession
XRSessionEvent
XRSpace
XRView
XRViewerPose
XRViewport
XRWebGLLayer