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)
This commit is contained in:
parent
96ff1c5c15
commit
67e019faba
|
@ -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),
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue