mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
webxr: Update XRPose interface to latest spec (#33146)
* Update XRPose interface with missing members Signed-off-by: Daniel Adams <msub2official@gmail.com> * ./mach fmt Signed-off-by: Daniel Adams <msub2official@gmail.com> --------- Signed-off-by: Daniel Adams <msub2official@gmail.com>
This commit is contained in:
parent
8e224cb4d3
commit
fb22dfb373
4 changed files with 25 additions and 20 deletions
|
@ -6,6 +6,9 @@
|
|||
|
||||
[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"]
|
||||
interface XRPose {
|
||||
readonly attribute XRRigidTransform transform;
|
||||
// readonly attribute boolean emulatedPosition;
|
||||
[SameObject] readonly attribute XRRigidTransform transform;
|
||||
[SameObject] readonly attribute DOMPointReadOnly? linearVelocity;
|
||||
[SameObject] readonly attribute DOMPointReadOnly? angularVelocity;
|
||||
|
||||
readonly attribute boolean emulatedPosition;
|
||||
};
|
||||
|
|
|
@ -7,6 +7,7 @@ use dom_struct::dom_struct;
|
|||
use crate::dom::bindings::codegen::Bindings::XRPoseBinding::XRPoseMethods;
|
||||
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
||||
use crate::dom::bindings::root::{Dom, DomRoot};
|
||||
use crate::dom::dompointreadonly::DOMPointReadOnly;
|
||||
use crate::dom::globalscope::GlobalScope;
|
||||
use crate::dom::xrrigidtransform::XRRigidTransform;
|
||||
use crate::dom::xrsession::ApiRigidTransform;
|
||||
|
@ -37,4 +38,23 @@ impl XRPoseMethods for XRPose {
|
|||
fn Transform(&self) -> DomRoot<XRRigidTransform> {
|
||||
DomRoot::from_ref(&self.transform)
|
||||
}
|
||||
|
||||
/// <https://www.w3.org/TR/webxr/#dom-xrpose-linearvelocity>
|
||||
fn GetLinearVelocity(&self) -> Option<DomRoot<DOMPointReadOnly>> {
|
||||
// TODO: Expose from webxr crate
|
||||
None
|
||||
}
|
||||
|
||||
/// <https://www.w3.org/TR/webxr/#dom-xrpose-angularvelocity>
|
||||
fn GetAngularVelocity(&self) -> Option<DomRoot<DOMPointReadOnly>> {
|
||||
// TODO: Expose from webxr crate
|
||||
None
|
||||
}
|
||||
|
||||
/// <https://www.w3.org/TR/webxr/#dom-xrpose-emulatedposition>
|
||||
fn EmulatedPosition(&self) -> bool {
|
||||
// There are currently no instances in which we would need to rely
|
||||
// on emulation for reporting pose, so return false.
|
||||
false
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue