1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

set_fov: Add support for time-based transitions (#9705)

This commit is contained in:
ANAND 2020-05-02 16:22:11 +05:30 committed by GitHub
parent ac368af4fe
commit e0ea87f1f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 123 additions and 34 deletions

View file

@ -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: