Skip to content

Commit

Permalink
fixup: plane offset handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed Nov 28, 2024
1 parent fd9e302 commit 6b18472
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
3 changes: 0 additions & 3 deletions crates/viewer/re_renderer/src/renderer/world_grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ pub struct WorldGridConfiguration {

/// How thick the lines are in UI units.
pub thickness_ui: f32,

/// Offset of the grid along its normal.
pub normal_offset: f32,
}

mod gpu_data {
Expand Down
9 changes: 4 additions & 5 deletions crates/viewer/re_space_view_spatial/src/ui_3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -735,12 +735,12 @@ impl SpatialSpaceView3D {
grid_config.component_or_fallback::<re_types::components::Color>(ctx, self, state)?;
let orientation =
grid_config.component_or_fallback::<PlaneOrientation>(ctx, self, state)?;
let normal_offset = **grid_config.component_or_fallback::<PlaneOffset>(ctx, self, state)?;
let plane = match orientation {
PlaneOrientation::Xy => re_math::Plane3::XY,
PlaneOrientation::Yz => re_math::Plane3::YZ,
PlaneOrientation::Xz => re_math::Plane3::ZX,
PlaneOrientation::Xy => re_math::Plane3::from_normal_dist(glam::Vec3::Z, normal_offset),
PlaneOrientation::Yz => re_math::Plane3::from_normal_dist(glam::Vec3::X, normal_offset),
PlaneOrientation::Xz => re_math::Plane3::from_normal_dist(glam::Vec3::Y, normal_offset),
};
let normal_offset = **grid_config.component_or_fallback::<PlaneOffset>(ctx, self, state)?;

let Some(render_ctx) = ctx.render_ctx else {
return Ok(None);
Expand All @@ -753,7 +753,6 @@ impl SpatialSpaceView3D {
plane,
spacing,
thickness_ui,
normal_offset,
},
)))
}
Expand Down

0 comments on commit 6b18472

Please sign in to comment.