Skip to content

Commit 06e7127

Browse files
jb55claude
andcommitted
nostrverse: fix rotation editor euler decomposition and tilemap z-fighting
to_euler(YXZ) returns (Y, X, Z) but the rotation editor and drag-snap code destructured as (_, y, _), reading the X angle instead of Y. Also bump the tilemap Y offset from 0.001 to 0.01 so depth buffer can distinguish it from the grid plane. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent cb2cfed commit 06e7127

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

crates/notedeck_nostrverse/src/room_view.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ pub fn show_room_view(
320320
let angle = delta_x * ROTATE_SENSITIVITY;
321321
let new_rotation = Quat::from_rotation_y(angle) * obj.rotation;
322322
let new_rotation = if state.grid_snap_enabled {
323-
let (_, y, _) = new_rotation.to_euler(glam::EulerRot::YXZ);
323+
let (y, _, _) = new_rotation.to_euler(glam::EulerRot::YXZ);
324324
let snap_rad = state.rotation_snap.to_radians();
325325
let snapped_y = (y / snap_rad).round() * snap_rad;
326326
Quat::from_rotation_y(snapped_y)
@@ -563,7 +563,7 @@ fn render_object_inspector(
563563
obj.scale = Vec3::new(sx, sy, sz);
564564

565565
// Editable Y rotation (degrees)
566-
let (_, angle_y, _) = obj.rotation.to_euler(glam::EulerRot::YXZ);
566+
let (angle_y, _, _) = obj.rotation.to_euler(glam::EulerRot::YXZ);
567567
let mut deg = angle_y.to_degrees();
568568
let rot_changed = ui
569569
.horizontal(|ui| {

crates/notedeck_nostrverse/src/tilemap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ pub fn build_tilemap_model(
237237
// Center the tilemap so origin is in the middle
238238
let offset_x = -(w as f32) / 2.0;
239239
let offset_z = -(h as f32) / 2.0;
240-
let y = 0.001_f32; // Just above ground to avoid z-fighting with grid
240+
let y = 0.01_f32; // Above ground plane to avoid z-fighting with grid
241241

242242
let normal = [0.0_f32, 1.0, 0.0]; // Facing up
243243
let tangent = [1.0_f32, 0.0, 0.0, 1.0]; // Tangent along +X

0 commit comments

Comments
 (0)