mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Basic XRRigidTransform interface
This commit is contained in:
parent
73c530344c
commit
520bb23048
3 changed files with 44 additions and 0 deletions
|
@ -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;
|
||||
|
|
13
components/script/dom/webidls/XRRigidTransform.webidl
Normal file
13
components/script/dom/webidls/XRRigidTransform.webidl
Normal 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;
|
||||
};
|
30
components/script/dom/xrrigidtransform.rs
Normal file
30
components/script/dom/xrrigidtransform.rs
Normal 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,
|
||||
)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue