Skip to content
This repository was archived by the owner on Feb 16, 2025. It is now read-only.

Commit 3d82ad9

Browse files
authored
Auto merge of #201 - mrobinson:update-euclid, r=jdm
Update euclid to 0.22 None
2 parents 4eb957a + 2c82ad0 commit 3d82ad9

File tree

7 files changed

+15
-12
lines changed

7 files changed

+15
-12
lines changed

Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ members = [
33
"webxr",
44
"webxr-api"
55
]
6+
7+
[patch.crates-io]
8+
surfman-chains = { git = "https://github.com/servo/surfman-chains.git" }

webxr-api/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ipc = ["serde", "ipc-channel", "euclid/serde"]
2323
profile = ["time"]
2424

2525
[dependencies]
26-
euclid = "0.20"
26+
euclid = "0.22"
2727
ipc-channel = { version = "0.14", optional = true }
2828
log = "0.4"
2929
serde = { version = "1.0", optional = true }

webxr-api/util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ pub fn frustum_to_projection_matrix<T, U>(
107107
let h = top - bottom;
108108
let d = far - near;
109109

110-
Transform3D::column_major(
110+
Transform3D::new(
111111
2. * near / w,
112112
0.,
113113
(right + left) / w,

webxr/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ profile = ["webxr-api/profile"]
3737
[dependencies]
3838
webxr-api = { path = "../webxr-api" }
3939
crossbeam-channel = "0.4"
40-
euclid = "0.20.10"
40+
euclid = "0.22"
4141
log = "0.4.6"
4242
gvr-sys = { version = "0.7", optional = true }
4343
openxr = { git = "https://github.com/servo/openxrs.git", branch="secondary-views-2", optional = true }
4444
serde = { version = "1.0", optional = true }
4545
sparkle = "0.1"
46-
surfman = "0.4"
47-
surfman-chains = "0.6"
46+
surfman = "0.5"
47+
surfman-chains = "0.7"
4848
time = "0.1.42"
4949

5050
[target.'cfg(target_os = "windows")'.dependencies]

webxr/glwindow/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ impl DeviceAPI for GlWindowDevice {
234234
RigidTransform3D::from_translation(translation);
235235
let rotation = Rotation3D::from_untyped(&self.window.get_rotation());
236236
let rotation = RigidTransform3D::from_rotation(rotation);
237-
let transform = translation.post_transform(&rotation);
237+
let transform = translation.then(&rotation);
238238
let sub_images = self.layer_manager().ok()?.begin_frame(layers).ok()?;
239239
Some(Frame {
240240
pose: Some(ViewerPose {
@@ -606,7 +606,7 @@ impl GlWindowDevice {
606606
let transform: RigidTransform3D<f32, Viewer, Eye> =
607607
RigidTransform3D::new(rotation, translation);
608608
View {
609-
transform: viewer.pre_transform(&transform.inverse()),
609+
transform: transform.inverse().then(&viewer),
610610
projection,
611611
}
612612
}
@@ -630,7 +630,7 @@ impl GlWindowDevice {
630630
{
631631
#[rustfmt::skip]
632632
// Sigh, row-major vs column-major
633-
return Transform3D::row_major(
633+
return Transform3D::new(
634634
f / aspect, 0.0, 0.0, 0.0,
635635
0.0, f, 0.0, 0.0,
636636
0.0, 0.0, (far + near) * nf, -1.0,

webxr/googlevr/device.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ impl GoogleVRDevice {
441441
// only translation
442442
let transform: RigidTransform3D<f32, Viewer, Eye> = decompose_rigid(&eye_mat);
443443

444-
let transform = viewer.pre_transform(&transform.inverse());
444+
let transform = transform.inverse().then(&viewer);
445445

446446
View {
447447
projection,

webxr/headless/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ fn view<Eye>(
216216
};
217217

218218
View {
219-
transform: viewer.pre_transform(&init.transform.inverse()),
219+
transform: init.transform.inverse().then(&viewer),
220220
projection,
221221
}
222222
}
@@ -560,11 +560,11 @@ impl HeadlessDeviceData {
560560
.cast_unit(),
561561
BaseSpace::Joint(..) => panic!("Cannot request mocking backend with hands"),
562562
};
563-
let space_origin = origin.pre_transform(&space.offset);
563+
let space_origin = space.offset.then(&origin);
564564

565565
let origin_rigid: RigidTransform3D<f32, ApiSpace, ApiSpace> = ray.origin.into();
566566
Some(Ray {
567-
origin: origin_rigid.post_transform(&space_origin).translation,
567+
origin: origin_rigid.then(&space_origin).translation,
568568
direction: space_origin.rotation.transform_vector3d(ray.direction),
569569
})
570570
}

0 commit comments

Comments
 (0)