summaryrefslogtreecommitdiff
path: root/src/localplayer.h
diff options
context:
space:
mode:
authorparamat <paramat@users.noreply.github.com>2017-11-20 01:45:57 +0000
committerparamat <mat.gregory@virginmedia.com>2017-12-04 02:25:10 +0000
commitf470cb7270560a26afff0a0eadfc69070236c109 (patch)
tree045b3cac767dfae7fffc02258d02cbaf7978a96f /src/localplayer.h
parent2507d32afe05c73bb27ed221c2a592b0894fdc68 (diff)
downloadminetest-f470cb7270560a26afff0a0eadfc69070236c109.tar.gz
minetest-f470cb7270560a26afff0a0eadfc69070236c109.tar.bz2
minetest-f470cb7270560a26afff0a0eadfc69070236c109.zip
Zoom: Set zoom FOV per-player using a player object property
Remove player object property 'can zoom'. Add player object property 'zoom fov'. Remove clientside setting for 'zoom fov'. Object property default is 15 degrees in creative mode, zoom disabled in survival mode. Needed due to zoom now loading and/or generating distant world according to zoom FOV. Update object properties serialisation version to 3.
Diffstat (limited to 'src/localplayer.h')
-rw-r--r--src/localplayer.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/localplayer.h b/src/localplayer.h
index 8e4378dfa..77d79e472 100644
--- a/src/localplayer.h
+++ b/src/localplayer.h
@@ -22,6 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "player.h"
#include "environment.h"
#include "constants.h"
+#include "settings.h"
#include <list>
class Client;
@@ -142,8 +143,8 @@ public:
void setCollisionbox(const aabb3f &box) { m_collisionbox = box; }
- bool getCanZoom() const { return m_can_zoom; }
- void setCanZoom(bool can_zoom) { m_can_zoom = can_zoom; }
+ float getZoomFOV() const { return m_zoom_fov; }
+ void setZoomFOV(float zoom_fov) { m_zoom_fov = zoom_fov; }
private:
void accelerateHorizontal(const v3f &target_speed, const f32 max_increase);
@@ -181,8 +182,8 @@ private:
bool camera_barely_in_ceiling = false;
aabb3f m_collisionbox = aabb3f(-BS * 0.30f, 0.0f, -BS * 0.30f, BS * 0.30f,
BS * 1.75f, BS * 0.30f);
- bool m_can_zoom = true;
float m_eye_height = 1.625f;
+ float m_zoom_fov = 0.0f;
GenericCAO *m_cao = nullptr;
Client *m_client;