From 67e019fabacc716ad2fda2d3cf9169d8fb612a6f Mon Sep 17 00:00:00 2001 From: Slushie <57730247+slushie0@users.noreply.github.com> Date: Sat, 31 Dec 2022 08:30:22 -0800 Subject: [PATCH] entity/player: rotate nametag to face player (#746) Nametag is rotated to face the player (Around the Y axes. it still doesn't rotate up or down, I don't know how to rotate it on both axis) --- src/entity/player.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/entity/player.rs b/src/entity/player.rs index c1fc976..eb738fa 100644 --- a/src/entity/player.rs +++ b/src/entity/player.rs @@ -211,12 +211,9 @@ impl ecs::System for PlayerRenderer { // TODO This sucks if player_model.has_name_tag { - let ang = (position.position.x - renderer.camera.pos.x) - .atan2(position.position.z - renderer.camera.pos.z) - as f32; mdl.matrix[PlayerModelPart::NameTag as usize] = Matrix4::from(Decomposed { scale: 1.0, - rot: Quaternion::from_angle_y(Rad(ang)), + rot: Quaternion::from_angle_y(Rad(renderer.camera.yaw as f32)), disp: offset + Vector3::new(0.0, (-24.0 / 16.0) - 0.6, 0.0), }); }