Basic XRViewerPose interface

This commit is contained in:
Manish Goregaokar 2018-12-19 16:44:53 -08:00
parent 581470016f
commit 31feb1eca2
3 changed files with 41 additions and 0 deletions

View file

@ -524,4 +524,5 @@ pub mod xrreferencespace;
pub mod xrsession; pub mod xrsession;
pub mod xrspace; pub mod xrspace;
pub mod xrstationaryreferencespace; pub mod xrstationaryreferencespace;
pub mod xrviewerpose;
pub mod xrwebgllayer; pub mod xrwebgllayer;

View file

@ -0,0 +1,10 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://immersive-web.github.io/webxr/#xrviewerpose-interface
[SecureContext, Exposed=Window] interface XRViewerPose {
// readonly attribute XRRigidTransform transform;
// readonly attribute FrozenArray<XRView> views;
};

View file

@ -0,0 +1,30 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::XRViewerPoseBinding;
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
use crate::dom::bindings::root::DomRoot;
use crate::dom::globalscope::GlobalScope;
use dom_struct::dom_struct;
#[dom_struct]
pub struct XRViewerPose {
reflector_: Reflector,
}
impl XRViewerPose {
fn new_inherited() -> XRViewerPose {
XRViewerPose {
reflector_: Reflector::new(),
}
}
pub fn new(global: &GlobalScope) -> DomRoot<XRViewerPose> {
reflect_dom_object(
Box::new(XRViewerPose::new_inherited()),
global,
XRViewerPoseBinding::Wrap,
)
}
}