mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Formatting.
This commit is contained in:
parent
dbff26bce0
commit
0e8ac3fdac
81 changed files with 588 additions and 206 deletions
|
@ -38,7 +38,11 @@ impl XRRay {
|
|||
}
|
||||
}
|
||||
|
||||
fn new(global: &GlobalScope, proto: Option<HandleObject>, ray: Ray<ApiSpace>) -> DomRoot<XRRay> {
|
||||
fn new(
|
||||
global: &GlobalScope,
|
||||
proto: Option<HandleObject>,
|
||||
ray: Ray<ApiSpace>,
|
||||
) -> DomRoot<XRRay> {
|
||||
reflect_dom_object2(Box::new(XRRay::new_inherited(ray)), global, proto)
|
||||
}
|
||||
|
||||
|
@ -70,19 +74,31 @@ impl XRRay {
|
|||
)
|
||||
.normalize();
|
||||
|
||||
Ok(Self::new(&window.global(), proto, Ray { origin, direction }))
|
||||
Ok(Self::new(
|
||||
&window.global(),
|
||||
proto,
|
||||
Ray { origin, direction },
|
||||
))
|
||||
}
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
/// https://immersive-web.github.io/hit-test/#dom-xrray-xrray-transform
|
||||
pub fn Constructor_(window: &Window, proto: Option<HandleObject>, transform: &XRRigidTransform) -> Fallible<DomRoot<Self>> {
|
||||
pub fn Constructor_(
|
||||
window: &Window,
|
||||
proto: Option<HandleObject>,
|
||||
transform: &XRRigidTransform,
|
||||
) -> Fallible<DomRoot<Self>> {
|
||||
let transform = transform.transform();
|
||||
let origin = transform.translation;
|
||||
let direction = transform
|
||||
.rotation
|
||||
.transform_vector3d(Vector3D::new(0., 0., -1.));
|
||||
|
||||
Ok(Self::new(&window.global(), proto, Ray { origin, direction }))
|
||||
Ok(Self::new(
|
||||
&window.global(),
|
||||
proto,
|
||||
Ray { origin, direction },
|
||||
))
|
||||
}
|
||||
|
||||
pub fn ray(&self) -> Ray<ApiSpace> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue