summaryrefslogtreecommitdiff
path: root/src/client/camera.h
diff options
context:
space:
mode:
authorANAND <ClobberXD@gmail.com>2020-05-02 16:22:11 +0530
committerGitHub <noreply@github.com>2020-05-02 12:52:11 +0200
commite0ea87f1f32273dba2eb5421c2a8c890479ba078 (patch)
treef4a64ef33340f60707f7cbe7b937bc183d0562c3 /src/client/camera.h
parentac368af4fe27f61f5a4209cdfe90956ff745993c (diff)
downloadminetest-e0ea87f1f32273dba2eb5421c2a8c890479ba078.tar.gz
minetest-e0ea87f1f32273dba2eb5421c2a8c890479ba078.tar.bz2
minetest-e0ea87f1f32273dba2eb5421c2a8c890479ba078.zip
set_fov: Add support for time-based transitions (#9705)
Diffstat (limited to 'src/client/camera.h')
-rw-r--r--src/client/camera.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/client/camera.h b/src/client/camera.h
index 6ec37fe10..3a59637bc 100644
--- a/src/client/camera.h
+++ b/src/client/camera.h
@@ -112,6 +112,9 @@ public:
return MYMAX(m_fov_x, m_fov_y);
}
+ // Notify about new server-sent FOV and initialize smooth FOV transition
+ void notifyFovChange();
+
// Checks if the constructor was able to create the scene nodes
bool successfullyCreated(std::string &error_message);
@@ -186,6 +189,9 @@ private:
Client *m_client;
+ // Default Client FOV (as defined by the "fov" setting)
+ f32 m_cache_fov;
+
// Absolute camera position
v3f m_camera_position;
// Absolute camera direction
@@ -193,6 +199,14 @@ private:
// Camera offset
v3s16 m_camera_offset;
+ // Server-sent FOV variables
+ bool m_server_sent_fov = false;
+ f32 m_curr_fov_degrees, m_old_fov_degrees, m_target_fov_degrees;
+
+ // FOV transition variables
+ bool m_fov_transition_active = false;
+ f32 m_fov_diff, m_transition_time;
+
v2f m_wieldmesh_offset = v2f(55.0f, -35.0f);
v2f m_arm_dir;
v2f m_cam_vel;
@@ -230,7 +244,6 @@ private:
f32 m_cache_fall_bobbing_amount;
f32 m_cache_view_bobbing_amount;
- f32 m_cache_fov;
bool m_arm_inertia;
std::list<Nametag *> m_nametags;