1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Zoom: Move enabling zoom to a new player object property

Default enabled for no change in default behaviour.
Remove 'zoom' privilege.
This commit is contained in:
paramat 2017-08-28 22:46:12 +01:00 committed by paramat
parent bd6b90359c
commit 561a01cc2a
8 changed files with 20 additions and 11 deletions

View file

@ -124,11 +124,9 @@ public:
v3s16 getLightPosition() const;
void setYaw(f32 yaw) { m_yaw = yaw; }
f32 getYaw() const { return m_yaw; }
void setPitch(f32 pitch) { m_pitch = pitch; }
f32 getPitch() const { return m_pitch; }
inline void setPosition(const v3f &position)
@ -143,6 +141,9 @@ 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; }
private:
void accelerateHorizontal(const v3f &target_speed, const f32 max_increase);
void accelerateVertical(const v3f &target_speed, const f32 max_increase);
@ -178,6 +179,7 @@ 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;
GenericCAO *m_cao = nullptr;
Client *m_client;