mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Add stub XRRay
This commit is contained in:
parent
7f353033f4
commit
b6a9e41bb8
4 changed files with 52 additions and 0 deletions
29
components/script/dom/xrray.rs
Normal file
29
components/script/dom/xrray.rs
Normal file
|
@ -0,0 +1,29 @@
|
|||
/* 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::reflector::{reflect_dom_object, Reflector};
|
||||
use crate::dom::bindings::root::DomRoot;
|
||||
use crate::dom::globalscope::GlobalScope;
|
||||
use dom_struct::dom_struct;
|
||||
use webxr_api::{ApiSpace, Ray};
|
||||
|
||||
#[dom_struct]
|
||||
pub struct XRRay {
|
||||
reflector_: Reflector,
|
||||
#[ignore_malloc_size_of = "defined in webxr"]
|
||||
ray: Ray<ApiSpace>,
|
||||
}
|
||||
|
||||
impl XRRay {
|
||||
fn new_inherited(ray: Ray<ApiSpace>) -> XRRay {
|
||||
XRRay {
|
||||
reflector_: Reflector::new(),
|
||||
ray,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new(global: &GlobalScope, ray: Ray<ApiSpace>) -> DomRoot<XRRay> {
|
||||
reflect_dom_object(Box::new(XRRay::new_inherited(ray)), global)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue