mirror of
https://github.com/servo/servo.git
synced 2025-08-08 06:55:31 +01:00
webxr: Implement reference space reset events (#33460)
* Initial interface implementation Signed-off-by: Daniel Adams <msub2official@gmail.com> * Add event handler Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update FakeXRDevice interface Signed-off-by: Daniel Adams <msub2official@gmail.com> * Implement reset event Signed-off-by: Daniel Adams <msub2official@gmail.com> * Downcast bounded spaces Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update expectations Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update webxr commit Signed-off-by: Daniel Adams <msub2official@gmail.com> * fmt Signed-off-by: Daniel Adams <msub2official@gmail.com> * Adjust DomRoot usage Signed-off-by: Daniel Adams <msub2official@gmail.com> * fmt Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update manifest Signed-off-by: Daniel Adams <msub2official@gmail.com> --------- Signed-off-by: Daniel Adams <msub2official@gmail.com>
This commit is contained in:
parent
b0cae28c83
commit
f8e0fde044
18 changed files with 210 additions and 90 deletions
|
@ -19,7 +19,7 @@ use crate::script_runtime::JSContext;
|
|||
|
||||
#[dom_struct]
|
||||
pub struct XRBoundedReferenceSpace {
|
||||
xrspace: XRReferenceSpace,
|
||||
reference_space: XRReferenceSpace,
|
||||
offset: Dom<XRRigidTransform>,
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ impl XRBoundedReferenceSpace {
|
|||
offset: &XRRigidTransform,
|
||||
) -> XRBoundedReferenceSpace {
|
||||
XRBoundedReferenceSpace {
|
||||
xrspace: XRReferenceSpace::new_inherited(
|
||||
reference_space: XRReferenceSpace::new_inherited(
|
||||
session,
|
||||
offset,
|
||||
XRReferenceSpaceType::Bounded_floor,
|
||||
|
@ -55,12 +55,16 @@ impl XRBoundedReferenceSpace {
|
|||
global,
|
||||
)
|
||||
}
|
||||
|
||||
pub fn reference_space(&self) -> &XRReferenceSpace {
|
||||
&self.reference_space
|
||||
}
|
||||
}
|
||||
|
||||
impl XRBoundedReferenceSpaceMethods for XRBoundedReferenceSpace {
|
||||
/// <https://www.w3.org/TR/webxr/#dom-xrboundedreferencespace-boundsgeometry>
|
||||
fn BoundsGeometry(&self, cx: JSContext) -> JSVal {
|
||||
if let Some(bounds) = self.xrspace.get_bounds() {
|
||||
if let Some(bounds) = self.reference_space.get_bounds() {
|
||||
let points: Vec<DomRoot<DOMPointReadOnly>> = bounds
|
||||
.into_iter()
|
||||
.map(|point| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue