From d504831ee2adf59421e82202e350f82701bd3cd0 Mon Sep 17 00:00:00 2001 From: TeTpaAka Date: Sat, 29 Jul 2017 19:24:10 +0200 Subject: Move the nametag back to the top of the player (#6179) read the actual height of the collisionbox --- src/camera.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/camera.cpp') diff --git a/src/camera.cpp b/src/camera.cpp index 027e0ffc8..efd8a3389 100644 --- a/src/camera.cpp +++ b/src/camera.cpp @@ -617,7 +617,7 @@ void Camera::drawNametags() // shadow can remain. continue; } - v3f pos = nametag->parent_node->getAbsolutePosition() + v3f(0.0, 1.1 * BS, 0.0); + v3f pos = nametag->parent_node->getAbsolutePosition() + nametag->nametag_pos * BS; f32 transformed_pos[4] = { pos.X, pos.Y, pos.Z, 1.0f }; trans.multiplyWith1x4Matrix(transformed_pos); if (transformed_pos[3] > 0) { @@ -641,9 +641,10 @@ void Camera::drawNametags() } Nametag *Camera::addNametag(scene::ISceneNode *parent_node, - std::string nametag_text, video::SColor nametag_color) + const std::string &nametag_text, video::SColor nametag_color, + const v3f &pos) { - Nametag *nametag = new Nametag(parent_node, nametag_text, nametag_color); + Nametag *nametag = new Nametag(parent_node, nametag_text, nametag_color, pos); m_nametags.push_back(nametag); return nametag; } -- cgit v1.2.3