diff options
author | Manish Goregaokar <manishsmail@gmail.com> | 2019-04-03 00:51:31 -0700 |
---|---|---|
committer | Manish Goregaokar <manishsmail@gmail.com> | 2019-04-03 23:55:33 -0700 |
commit | 08079c4d2809785bd14359a9a484d5108f8467cb (patch) | |
tree | 8dfef176fa12dc389d35923d6c131654413e3a64 /components/script/dom/xrrigidtransform.rs | |
parent | 1f3f37225f2f2b10bdffe171d8300ab2c9aad7f2 (diff) | |
download | servo-08079c4d2809785bd14359a9a484d5108f8467cb.tar.gz servo-08079c4d2809785bd14359a9a484d5108f8467cb.zip |
Switch XRSpace code to using rigid transforms
Diffstat (limited to 'components/script/dom/xrrigidtransform.rs')
-rw-r--r-- | components/script/dom/xrrigidtransform.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/components/script/dom/xrrigidtransform.rs b/components/script/dom/xrrigidtransform.rs index 98ca2c11239..c89ffaa3d39 100644 --- a/components/script/dom/xrrigidtransform.rs +++ b/components/script/dom/xrrigidtransform.rs @@ -13,7 +13,7 @@ use crate::dom::bindings::root::{DomRoot, MutNullableDom}; use crate::dom::dompointreadonly::DOMPointReadOnly; use crate::dom::window::Window; use dom_struct::dom_struct; -use euclid::{RigidTransform3D, Rotation3D, Transform3D, Vector3D}; +use euclid::{RigidTransform3D, Rotation3D, Vector3D}; #[dom_struct] pub struct XRRigidTransform { @@ -34,7 +34,6 @@ impl XRRigidTransform { } } - #[allow(unused)] pub fn new(global: &Window, transform: RigidTransform3D<f64>) -> DomRoot<XRRigidTransform> { reflect_dom_object( Box::new(XRRigidTransform::new_inherited(transform)), @@ -43,7 +42,6 @@ impl XRRigidTransform { ) } - #[allow(unused)] pub fn identity(window: &Window) -> DomRoot<XRRigidTransform> { let transform = RigidTransform3D::identity(); XRRigidTransform::new(window, transform) @@ -97,9 +95,8 @@ impl XRRigidTransformMethods for XRRigidTransform { } impl XRRigidTransform { - pub fn matrix(&self) -> Transform3D<f64> { - // Spec says the orientation applies first, - // so post-multiply (?) - self.transform.to_transform() + /// https://immersive-web.github.io/webxr/#dom-xrpose-transform + pub fn transform(&self) -> RigidTransform3D<f64> { + self.transform } } |