summaryrefslogtreecommitdiff
path: root/src/player.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/player.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/player.h')
-rw-r--r--src/player.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/player.h b/src/player.h
index de7f427e9..3bc7762fa 100644
--- a/src/player.h
+++ b/src/player.h
@@ -35,7 +35,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
struct PlayerFovSpec
{
f32 fov;
+
+ // Whether to multiply the client's FOV or to override it
bool is_multiplier;
+
+ // The time to be take to trasition to the new FOV value.
+ // Transition is instantaneous if omitted. Omitted by default.
+ f32 transition_time;
};
struct PlayerControl
@@ -186,12 +192,12 @@ public:
void setFov(const PlayerFovSpec &spec)
{
- m_fov_spec = spec;
+ m_fov_override_spec = spec;
}
const PlayerFovSpec &getFov() const
{
- return m_fov_spec;
+ return m_fov_override_spec;
}
u32 keyPressed = 0;
@@ -208,7 +214,7 @@ protected:
char m_name[PLAYERNAME_SIZE];
v3f m_speed;
u16 m_wield_index = 0;
- PlayerFovSpec m_fov_spec = { 0.0f, false };
+ PlayerFovSpec m_fov_override_spec = { 0.0f, false, 0.0f };
std::vector<HudElement *> hud;
private: