aboutsummaryrefslogtreecommitdiff
path: root/src/camera.h
diff options
context:
space:
mode:
authorRealBadAngel <maciej.kasatkin@o2.pl>2016-02-15 14:01:01 +0100
committerest31 <MTest31@outlook.com>2016-02-18 16:43:29 +0100
commitc3b279750ece0b5144bf8e973d55108347462223 (patch)
tree1c7acbe456ed6e29a34fd7486c7d888df4d8f2fa /src/camera.h
parent4c654557ecc32620b78c146bd6d90f531a71d25a (diff)
downloadminetest-c3b279750ece0b5144bf8e973d55108347462223.tar.gz
minetest-c3b279750ece0b5144bf8e973d55108347462223.tar.bz2
minetest-c3b279750ece0b5144bf8e973d55108347462223.zip
Move object nametags to camera
Diffstat (limited to 'src/camera.h')
-rw-r--r--src/camera.h30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/camera.h b/src/camera.h
index 006f4b3ce..2df7da2b8 100644
--- a/src/camera.h
+++ b/src/camera.h
@@ -26,6 +26,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "client/tile.h"
#include "util/numeric.h"
#include <ICameraSceneNode.h>
+#include <ISceneNode.h>
+#include <list>
#include "client.h"
@@ -34,6 +36,20 @@ struct MapDrawControl;
class IGameDef;
class WieldMeshSceneNode;
+struct Nametag {
+ Nametag(scene::ISceneNode *a_parent_node,
+ const std::string &a_nametag_text,
+ const video::SColor &a_nametag_color):
+ parent_node(a_parent_node),
+ nametag_text(a_nametag_text),
+ nametag_color(a_nametag_color)
+ {
+ }
+ scene::ISceneNode *parent_node;
+ std::string nametag_text;
+ video::SColor nametag_color;
+};
+
enum CameraMode {CAMERA_MODE_FIRST, CAMERA_MODE_THIRD, CAMERA_MODE_THIRD_FRONT};
/*
@@ -84,7 +100,7 @@ public:
{
return m_camera_direction;
}
-
+
// Get the camera offset
inline v3s16 getOffset() const
{
@@ -151,6 +167,13 @@ public:
return m_camera_mode;
}
+ Nametag *addNametag(scene::ISceneNode *parent_node,
+ std::string nametag_text, video::SColor nametag_color);
+
+ void removeNametag(Nametag *nametag);
+
+ void drawNametags();
+
private:
// Nodes
scene::ISceneNode* m_playernode;
@@ -162,8 +185,9 @@ private:
// draw control
MapDrawControl& m_draw_control;
-
+
IGameDef *m_gamedef;
+ video::IVideoDriver *m_driver;
// Absolute camera position
v3f m_camera_position;
@@ -214,6 +238,8 @@ private:
f32 m_cache_wanted_fps;
f32 m_cache_fov;
bool m_cache_view_bobbing;
+
+ std::list<Nametag *> m_nametags;
};
#endif