File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 55use crate :: dom:: bindings:: codegen:: Bindings :: DOMPointBinding :: DOMPointInit ;
66use crate :: dom:: bindings:: codegen:: Bindings :: XRRigidTransformBinding ;
77use crate :: dom:: bindings:: codegen:: Bindings :: XRRigidTransformBinding :: XRRigidTransformMethods ;
8+ use crate :: dom:: bindings:: error:: Error ;
89use crate :: dom:: bindings:: error:: Fallible ;
910use crate :: dom:: bindings:: reflector:: DomObject ;
1011use crate :: dom:: bindings:: reflector:: { reflect_dom_object, Reflector } ;
@@ -54,7 +55,13 @@ impl XRRigidTransform {
5455 position : & DOMPointInit ,
5556 orientation : & DOMPointInit ,
5657 ) -> Fallible < DomRoot < Self > > {
57- let global = window. global ( ) ;
58+ if position. w != 1.0 {
59+ return Err ( Error :: Type ( format ! (
60+ "XRRigidTransform must be constructed with a position that has a w value of of 1.0, not {}" ,
61+ position. w
62+ ) ) ) ;
63+ }
64+
5865 let translate = Vector3D :: new ( position. x as f64 , position. y as f64 , position. z as f64 ) ;
5966 let rotate = Rotation3D :: unit_quaternion (
6067 orientation. x as f64 ,
You can’t perform that action at this time.
0 commit comments