mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Add XRSession::requestHitTestSource()
This commit is contained in:
parent
f1d6a89150
commit
1b07b77323
9 changed files with 131 additions and 22 deletions
|
@ -13,7 +13,7 @@ use crate::dom::xrsession::{cast_transform, ApiPose, ApiViewerPose, XRSession};
|
|||
use crate::dom::xrspace::XRSpace;
|
||||
use dom_struct::dom_struct;
|
||||
use euclid::RigidTransform3D;
|
||||
use webxr_api::Frame;
|
||||
use webxr_api::{BaseSpace, Frame, Space};
|
||||
|
||||
#[dom_struct]
|
||||
pub struct XRReferenceSpace {
|
||||
|
@ -57,6 +57,17 @@ impl XRReferenceSpace {
|
|||
global,
|
||||
)
|
||||
}
|
||||
|
||||
pub fn space(&self) -> Space {
|
||||
let base = match self.ty {
|
||||
XRReferenceSpaceType::Local => BaseSpace::Local,
|
||||
XRReferenceSpaceType::Viewer => BaseSpace::Viewer,
|
||||
XRReferenceSpaceType::Local_floor => BaseSpace::Floor,
|
||||
_ => panic!("unsupported reference space found"),
|
||||
};
|
||||
let offset = self.offset.transform();
|
||||
Space { base, offset }
|
||||
}
|
||||
}
|
||||
|
||||
impl XRReferenceSpaceMethods for XRReferenceSpace {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue