Basic XRRigidTransform interface

This commit is contained in:
Manish Goregaokar 2018-12-19 16:50:27 -08:00
parent 73c530344c
commit 520bb23048
3 changed files with 44 additions and 0 deletions

View file

@ -521,6 +521,7 @@ pub mod xr;
pub mod xrframe;
pub mod xrlayer;
pub mod xrreferencespace;
pub mod xrrigidtransform;
pub mod xrsession;
pub mod xrspace;
pub mod xrstationaryreferencespace;

View file

@ -0,0 +1,13 @@
/* 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/#xrrigidtransform-interface
[SecureContext, Exposed=Window]
// [Constructor(optional DOMPointInit position, optional DOMPointInit orientation)]
interface XRRigidTransform {
// readonly attribute DOMPointReadOnly position;
// readonly attribute DOMPointReadOnly orientation;
// readonly attribute Float32Array matrix;
};

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::XRRigidTransformBinding;
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 XRRigidTransform {
reflector_: Reflector,
}
impl XRRigidTransform {
fn new_inherited() -> XRRigidTransform {
XRRigidTransform {
reflector_: Reflector::new(),
}
}
pub fn new(global: &GlobalScope) -> DomRoot<XRRigidTransform> {
reflect_dom_object(
Box::new(XRRigidTransform::new_inherited()),
global,
XRRigidTransformBinding::Wrap,
)
}
}