mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Support for webxr layer management
This commit is contained in:
parent
af110ac21f
commit
349619ed2d
34 changed files with 949 additions and 642 deletions
|
@ -20,6 +20,8 @@ use crate::dom::xrviewerpose::XRViewerPose;
|
|||
use dom_struct::dom_struct;
|
||||
use std::cell::Cell;
|
||||
use webxr_api::Frame;
|
||||
use webxr_api::LayerId;
|
||||
use webxr_api::SubImages;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct XRFrame {
|
||||
|
@ -59,6 +61,14 @@ impl XRFrame {
|
|||
pub fn get_pose(&self, space: &XRSpace) -> Option<ApiPose> {
|
||||
space.get_pose(&self.data)
|
||||
}
|
||||
|
||||
pub fn get_sub_images(&self, layer_id: LayerId) -> Option<&SubImages> {
|
||||
self.data
|
||||
.sub_images
|
||||
.iter()
|
||||
.filter(|sub_images| sub_images.layer_id == layer_id)
|
||||
.next()
|
||||
}
|
||||
}
|
||||
|
||||
impl XRFrameMethods for XRFrame {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue