mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Make viewerSpace [SameObject]
This commit is contained in:
parent
d4a6a4987d
commit
0756923e52
2 changed files with 5 additions and 2 deletions
|
@ -20,7 +20,7 @@ interface XRSession : EventTarget {
|
|||
readonly attribute XREnvironmentBlendMode environmentBlendMode;
|
||||
|
||||
readonly attribute XRRenderState renderState;
|
||||
readonly attribute XRSpace viewerSpace;
|
||||
[SameObject] readonly attribute XRSpace viewerSpace;
|
||||
|
||||
// // Methods
|
||||
Promise<XRReferenceSpace> requestReferenceSpace(XRReferenceSpaceOptions options);
|
||||
|
|
|
@ -34,6 +34,7 @@ pub struct XRSession {
|
|||
display: Dom<VRDisplay>,
|
||||
base_layer: MutNullableDom<XRLayer>,
|
||||
blend_mode: XREnvironmentBlendMode,
|
||||
viewer_space: MutNullableDom<XRSpace>,
|
||||
}
|
||||
|
||||
impl XRSession {
|
||||
|
@ -44,6 +45,7 @@ impl XRSession {
|
|||
base_layer: Default::default(),
|
||||
// we don't yet support any AR devices
|
||||
blend_mode: XREnvironmentBlendMode::Opaque,
|
||||
viewer_space: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,7 +89,8 @@ impl XRSessionMethods for XRSession {
|
|||
|
||||
// https://immersive-web.github.io/webxr/#dom-xrsession-viewerspace
|
||||
fn ViewerSpace(&self) -> DomRoot<XRSpace> {
|
||||
XRSpace::new_viewerspace(&self.global(), &self)
|
||||
self.viewer_space
|
||||
.or_init(|| XRSpace::new_viewerspace(&self.global(), &self))
|
||||
}
|
||||
|
||||
/// https://immersive-web.github.io/webxr/#dom-xrsession-requestanimationframe
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue