diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-12-28 17:34:07 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-12-28 17:34:07 +0200 |
commit | 7937813c98255736c6847fe2d1302e0c6b309b04 (patch) | |
tree | 584c26ef63d273473c44fae577faa07bfb3b4e36 /src/player.h | |
parent | ad4040d982ad0a52a27df262351fd747b5408265 (diff) | |
download | minetest-7937813c98255736c6847fe2d1302e0c6b309b04.tar.gz minetest-7937813c98255736c6847fe2d1302e0c6b309b04.tar.bz2 minetest-7937813c98255736c6847fe2d1302e0c6b309b04.zip |
Add get_look_dir(), get_look_pitch() and get_look_yaw() for players
Diffstat (limited to 'src/player.h')
-rw-r--r-- | src/player.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/player.h b/src/player.h index 107c829f8..1c9dde7e0 100644 --- a/src/player.h +++ b/src/player.h @@ -102,6 +102,16 @@ public: return m_yaw; } + f32 getRadPitch() + { + return -1.0 * m_pitch * core::DEGTORAD; + } + + f32 getRadYaw() + { + return (m_yaw + 90.) * core::DEGTORAD; + } + virtual void updateName(const char *name) { snprintf(m_name, PLAYERNAME_SIZE, "%s", name); |