Skip to content

Commit 734adde

Browse files
authored
Update glam to 0.30, and replace re_math with macaw (#10119)
1 parent 6b915c5 commit 734adde

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+119
-122
lines changed

Cargo.lock

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3590,9 +3590,9 @@ dependencies = [
35903590

35913591
[[package]]
35923592
name = "glam"
3593-
version = "0.28.0"
3593+
version = "0.30.3"
35943594
source = "registry+https://github.com/rust-lang/crates.io-index"
3595-
checksum = "779ae4bf7e8421cf91c0b3b64e7e8b40b862fba4d393f59150042de7c4965a94"
3595+
checksum = "6b46b9ca4690308844c644e7c634d68792467260e051c8543e0c7871662b3ba7"
35963596
dependencies = [
35973597
"bytemuck",
35983598
"serde",
@@ -3878,12 +3878,13 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
38783878

38793879
[[package]]
38803880
name = "hexasphere"
3881-
version = "14.1.0"
3881+
version = "16.0.0"
38823882
source = "registry+https://github.com/rust-lang/crates.io-index"
3883-
checksum = "344d5bf5d6b6da1020fcfd4014d44e0cc695356c603db9c774b30bd6d385ad2b"
3883+
checksum = "29a164ceff4500f2a72b1d21beaa8aa8ad83aec2b641844c659b190cb3ea2e0b"
38843884
dependencies = [
38853885
"constgebra",
38863886
"glam",
3887+
"tinyvec",
38873888
]
38883889

38893890
[[package]]
@@ -4843,6 +4844,17 @@ dependencies = [
48434844
"pkg-config",
48444845
]
48454846

4847+
[[package]]
4848+
name = "macaw"
4849+
version = "0.30.0"
4850+
source = "registry+https://github.com/rust-lang/crates.io-index"
4851+
checksum = "4c96b82556b0d4aa25cd4771b64ef9bde7c120afb588a083fcb242bf01e4a09b"
4852+
dependencies = [
4853+
"glam",
4854+
"num-traits",
4855+
"serde",
4856+
]
4857+
48464858
[[package]]
48474859
name = "malloc_buf"
48484860
version = "0.0.6"
@@ -7211,16 +7223,6 @@ dependencies = [
72117223
"web-time",
72127224
]
72137225

7214-
[[package]]
7215-
name = "re_math"
7216-
version = "0.20.0"
7217-
source = "registry+https://github.com/rust-lang/crates.io-index"
7218-
checksum = "999db5029a2879efeddb538f2e486aabf33adf7a0b3708c6df5c1cae13b3af49"
7219-
dependencies = [
7220-
"glam",
7221-
"serde",
7222-
]
7223-
72247226
[[package]]
72257227
name = "re_memory"
72267228
version = "0.24.0-alpha.1+dev"
@@ -7393,6 +7395,7 @@ dependencies = [
73937395
"half",
73947396
"itertools 0.14.0",
73957397
"js-sys",
7398+
"macaw",
73967399
"never",
73977400
"notify",
73987401
"ordered-float 4.4.0",
@@ -7403,7 +7406,6 @@ dependencies = [
74037406
"re_build_tools",
74047407
"re_error",
74057408
"re_log",
7406-
"re_math",
74077409
"re_tracing",
74087410
"re_video",
74097411
"serde",
@@ -7434,10 +7436,10 @@ dependencies = [
74347436
"glam",
74357437
"image",
74367438
"itertools 0.14.0",
7439+
"macaw",
74377440
"pollster 0.4.0",
74387441
"rand",
74397442
"re_log",
7440-
"re_math",
74417443
"re_renderer",
74427444
"wasm-bindgen-futures",
74437445
"web-sys",
@@ -7627,6 +7629,7 @@ dependencies = [
76277629
"infer",
76287630
"itertools 0.14.0",
76297631
"linked-hash-map",
7632+
"macaw",
76307633
"mime_guess2",
76317634
"mint",
76327635
"ndarray",
@@ -7640,7 +7643,6 @@ dependencies = [
76407643
"re_format",
76417644
"re_log",
76427645
"re_log_types",
7643-
"re_math",
76447646
"re_tracing",
76457647
"re_types_builder",
76467648
"re_types_core",
@@ -7888,11 +7890,11 @@ dependencies = [
78887890
"egui",
78897891
"glam",
78907892
"itertools 0.14.0",
7893+
"macaw",
78917894
"re_data_ui",
78927895
"re_entity_db",
78937896
"re_log",
78947897
"re_log_types",
7895-
"re_math",
78967898
"re_query",
78977899
"re_renderer",
78987900
"re_tracing",
@@ -7919,6 +7921,7 @@ dependencies = [
79197921
"image",
79207922
"insta",
79217923
"itertools 0.14.0",
7924+
"macaw",
79227925
"ndarray",
79237926
"nohash-hasher",
79247927
"once_cell",
@@ -7931,7 +7934,6 @@ dependencies = [
79317934
"re_format",
79327935
"re_log",
79337936
"re_log_types",
7934-
"re_math",
79357937
"re_query",
79367938
"re_renderer",
79377939
"re_tracing",
@@ -8141,6 +8143,7 @@ dependencies = [
81418143
"indexmap 2.8.0",
81428144
"itertools 0.14.0",
81438145
"linked-hash-map",
8146+
"macaw",
81448147
"ndarray",
81458148
"nohash-hasher",
81468149
"once_cell",
@@ -8154,7 +8157,6 @@ dependencies = [
81548157
"re_grpc_client",
81558158
"re_log",
81568159
"re_log_types",
8157-
"re_math",
81588160
"re_query",
81598161
"re_renderer",
81608162
"re_smart_channel",
@@ -9878,9 +9880,9 @@ dependencies = [
98789880

98799881
[[package]]
98809882
name = "tinyvec"
9881-
version = "1.8.0"
9883+
version = "1.9.0"
98829884
source = "registry+https://github.com/rust-lang/crates.io-index"
9883-
checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938"
9885+
checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71"
98849886
dependencies = [
98859887
"tinyvec_macros",
98869888
]

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ re_viewport_blueprint = { path = "crates/viewer/re_viewport_blueprint", version
138138
re_web_viewer_server = { path = "crates/viewer/re_web_viewer_server", version = "=0.24.0-alpha.1", default-features = false }
139139

140140
# Rerun crates in other repos:
141-
re_math = "0.20.0"
141+
re_mp4 = "0.3.0"
142142

143143
# If this package fails to build, install `nasm` locally, or build through `pixi`.
144144
# NOTE: we use `dav1d` as an alias for our own re_rav1d crate
@@ -221,11 +221,11 @@ flatbuffers = "24.12.23"
221221
futures = "0.3"
222222
futures-util = "0.3"
223223
getrandom = "0.2"
224-
glam = { version = "0.28", features = ["debug-glam-assert"] }
224+
glam = { version = "0.30.3", features = ["debug-glam-assert"] }
225225
glob = "0.3"
226226
gltf = "1.1"
227227
half = { version = "2.3.1", features = ["bytemuck"] }
228-
hexasphere = "14.1.0"
228+
hexasphere = "16.0.0"
229229
home = "=0.5.9"
230230
image = { version = "0.25", default-features = false }
231231
indent = "0.1"
@@ -242,11 +242,11 @@ linked-hash-map = { version = "0.5", default-features = false }
242242
log = "0.4"
243243
log-once = "0.4"
244244
lz4_flex = "0.11"
245+
macaw = "0.30.0"
245246
memory-stats = "1.1"
246247
mimalloc = "0.1.43"
247248
mime_guess2 = "2.0" # infer MIME type by file extension, and map mime to file extension
248249
mint = "0.5.9"
249-
re_mp4 = "0.3.0"
250250
natord = "1.0.9"
251251
ndarray = "0.16"
252252
ndarray-rand = "0.15"

crates/store/re_types/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ ecolor = ["dep:ecolor"]
3333
## Enable conversions to plot primitives
3434
egui_plot = ["dep:egui_plot"]
3535

36-
## Add support for some math operations using [`glam`](https://crates.io/crates/glam/) and [`re_math`](https://crates.io/crates/re_math/).
37-
glam = ["dep:glam", "dep:re_math"]
36+
## Add support for some math operations using [`glam`](https://crates.io/crates/glam/) and [`macaw`](https://crates.io/crates/macaw/).
37+
glam = ["dep:glam", "dep:macaw"]
3838

3939
## Integration with the [`image`](https://crates.io/crates/image/) crate, plus JPEG and TIFF support.
4040
image = ["dep:ecolor", "dep:image", "dep:tiff"]
@@ -90,7 +90,7 @@ image = { workspace = true, optional = true, default-features = false, features
9090
"jpeg",
9191
] }
9292
mint = { workspace = true, optional = true }
93-
re_math = { workspace = true, optional = true }
93+
macaw = { workspace = true, optional = true }
9494
serde = { workspace = true, optional = true, features = ["derive", "rc"] }
9595

9696

crates/store/re_types/src/components/plane3d_ext.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ impl Plane3D {
2020
}
2121

2222
#[cfg(feature = "glam")]
23-
impl From<Plane3D> for re_math::Plane3 {
23+
impl From<Plane3D> for macaw::Plane3 {
2424
#[inline]
2525
fn from(plane: Plane3D) -> Self {
2626
Self {

crates/store/re_types/src/datatypes/plane3d_ext.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ impl Plane3D {
3333
}
3434

3535
#[cfg(feature = "glam")]
36-
impl From<re_math::Plane3> for Plane3D {
36+
impl From<macaw::Plane3> for Plane3D {
3737
#[inline]
38-
fn from(plane: re_math::Plane3) -> Self {
38+
fn from(plane: macaw::Plane3) -> Self {
3939
Self([plane.normal.x, plane.normal.y, plane.normal.z, plane.d])
4040
}
4141
}
4242

4343
#[cfg(feature = "glam")]
44-
impl From<Plane3D> for re_math::Plane3 {
44+
impl From<Plane3D> for macaw::Plane3 {
4545
#[inline]
4646
fn from(plane: Plane3D) -> Self {
4747
Self {

crates/viewer/re_renderer/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ serde = ["dep:serde"]
5353
[dependencies]
5454
re_error.workspace = true
5555
re_log.workspace = true
56-
re_math.workspace = true
56+
macaw.workspace = true
5757
re_tracing.workspace = true
5858
re_video = { workspace = true, default-features = true }
5959

crates/viewer/re_renderer/src/importer/cpu_model.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ impl CpuModel {
5252
});
5353
}
5454

55-
pub fn calculate_bounding_box(&self) -> re_math::BoundingBox {
56-
re_math::BoundingBox::from_points(
55+
pub fn calculate_bounding_box(&self) -> macaw::BoundingBox {
56+
macaw::BoundingBox::from_points(
5757
self.instances
5858
.iter()
5959
.filter_map(|mesh_instance| {

crates/viewer/re_renderer/src/line_drawable_builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ impl<'ctx> LineBatchBuilder<'_, 'ctx> {
332332
/// Returns None for empty and non-finite boxes.
333333
pub fn add_box_outline(
334334
&mut self,
335-
bbox: &re_math::BoundingBox,
335+
bbox: &macaw::BoundingBox,
336336
) -> Option<LineStripBuilder<'_, 'ctx>> {
337337
if !bbox.is_something() || !bbox.is_finite() {
338338
return None;

crates/viewer/re_renderer/src/renderer/depth_cloud.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ impl DepthCloud {
171171
///
172172
/// Assumes max extent to be the maximum depth used for colormapping
173173
/// but ignores the minimum depth, using the frustum's origin instead.
174-
pub fn world_space_bbox(&self) -> re_math::BoundingBox {
174+
pub fn world_space_bbox(&self) -> macaw::BoundingBox {
175175
let max_depth = self.min_max_depth_in_world[1];
176176
let w = self.depth_dimensions.x as f32;
177177
let h = self.depth_dimensions.y as f32;
@@ -187,7 +187,7 @@ impl DepthCloud {
187187
let focal_length = glam::vec2(intrinsics.col(0).x, intrinsics.col(1).y);
188188
let offset = intrinsics.col(2).truncate();
189189

190-
let mut bbox = re_math::BoundingBox::NOTHING;
190+
let mut bbox = macaw::BoundingBox::nothing();
191191

192192
for corner in corners {
193193
let depth = corner.z;

crates/viewer/re_renderer/src/renderer/world_grid.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub struct WorldGridConfiguration {
2121
pub color: Rgba,
2222

2323
/// The plane in which the grid lines are drawn.
24-
pub plane: re_math::Plane3,
24+
pub plane: macaw::Plane3,
2525

2626
/// How far apart the closest sets of lines are.
2727
pub spacing: f32,

crates/viewer/re_renderer/src/view_builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ pub struct TargetConfiguration {
195195

196196
/// The viewport resolution in physical pixels.
197197
pub resolution_in_pixel: [u32; 2],
198-
pub view_from_world: re_math::IsoTransform,
198+
pub view_from_world: macaw::IsoTransform,
199199
pub projection_from_view: Projection,
200200

201201
/// Defines a viewport transformation from the projected space to the final image space.

crates/viewer/re_renderer_examples/2d.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ impl framework::Example for Render2D {
295295
TargetConfiguration {
296296
name: "2D".into(),
297297
resolution_in_pixel: splits[0].resolution_in_pixel,
298-
view_from_world: re_math::IsoTransform::IDENTITY,
298+
view_from_world: macaw::IsoTransform::IDENTITY,
299299
projection_from_view: Projection::Orthographic {
300300
camera_mode:
301301
view_builder::OrthographicCameraMode::TopLeftCornerAndExtendZ,
@@ -331,7 +331,7 @@ impl framework::Example for Render2D {
331331
view_builder::TargetConfiguration {
332332
name: "3D".into(),
333333
resolution_in_pixel: splits[1].resolution_in_pixel,
334-
view_from_world: re_math::IsoTransform::look_at_rh(
334+
view_from_world: macaw::IsoTransform::look_at_rh(
335335
camera_position,
336336
camera_rotation_center,
337337
glam::Vec3::Y,

crates/viewer/re_renderer_examples/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ path = "world_grid.rs"
4242

4343
[dependencies]
4444
re_log = { workspace = true, features = ["setup"] }
45-
re_math.workspace = true
45+
macaw.workspace = true
4646
re_renderer = { workspace = true, features = ["import-obj", "import-gltf"] }
4747

4848
ahash.workspace = true

crates/viewer/re_renderer_examples/depth_cloud.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use std::f32::consts::TAU;
1717

1818
use glam::Vec3;
1919
use itertools::Itertools as _;
20-
use re_math::IsoTransform;
20+
use macaw::IsoTransform;
2121
use re_renderer::{
2222
Color32, LineDrawableBuilder, PointCloudBuilder, Rgba, Size,
2323
renderer::{

crates/viewer/re_renderer_examples/depth_offset.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl framework::Example for Render2D {
9999
view_builder::TargetConfiguration {
100100
name: "3D".into(),
101101
resolution_in_pixel: resolution,
102-
view_from_world: re_math::IsoTransform::look_at_rh(
102+
view_from_world: macaw::IsoTransform::look_at_rh(
103103
glam::Vec3::Z * 2.0 * self.distance_scale,
104104
glam::Vec3::ZERO,
105105
glam::Vec3::Y,

crates/viewer/re_renderer_examples/multiview.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use std::f32::consts::TAU;
55
use framework::Example;
66
use glam::Vec3;
77
use itertools::Itertools as _;
8+
use macaw::IsoTransform;
89
use rand::Rng as _;
9-
use re_math::IsoTransform;
1010

1111
use re_renderer::{
1212
Color32, GpuReadbackIdentifier, Hsva, LineDrawableBuilder, PointCloudBuilder, RenderContext,

crates/viewer/re_renderer_examples/outlines.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl framework::Example for Outlines {
5555
TargetConfiguration {
5656
name: "OutlinesDemo".into(),
5757
resolution_in_pixel: resolution,
58-
view_from_world: re_math::IsoTransform::look_at_rh(
58+
view_from_world: macaw::IsoTransform::look_at_rh(
5959
camera_position,
6060
glam::Vec3::ZERO,
6161
glam::Vec3::Y,

crates/viewer/re_renderer_examples/picking.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ impl framework::Example for Picking {
126126
TargetConfiguration {
127127
name: "OutlinesDemo".into(),
128128
resolution_in_pixel: resolution,
129-
view_from_world: re_math::IsoTransform::look_at_rh(
129+
view_from_world: macaw::IsoTransform::look_at_rh(
130130
camera_position,
131131
glam::Vec3::ZERO,
132132
glam::Vec3::Y,

0 commit comments

Comments
 (0)