From f95a69c095846698954e8e7149e5d33f06a9ad5e Mon Sep 17 00:00:00 2001 From: hut Date: Tue, 16 Apr 2024 23:31:08 +0200 Subject: [PATCH] fix jupiter's rotational axis --- src/world.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/world.rs b/src/world.rs index 6124007..cec5bce 100644 --- a/src/world.rs +++ b/src/world.rs @@ -455,15 +455,16 @@ fn handle_cheats( // This avoids rendering glitches when very far away from the origin. pub fn position_to_transform( q_player: Query<&Position, With>, - mut q_trans: Query<(&'static mut Transform, &'static Position), Without>, + mut q_trans: Query<(&'static mut Transform, &'static Position, &'static Rotation), Without>, ) { if let Ok(player_pos) = q_player.get_single() { - for (mut transform, pos) in &mut q_trans { + for (mut transform, pos, rot) in &mut q_trans { transform.translation = Vec3::new( (pos.x - player_pos.x) as f32, (pos.y - player_pos.y) as f32, (pos.z - player_pos.z) as f32, ); + transform.rotation = rot.as_quat(); } } }