Skip to content

Commit

Permalink
[GameState] Now using a 70° FOV.
Browse files Browse the repository at this point in the history
  • Loading branch information
Unarelith committed Jan 25, 2020
1 parent 758f556 commit b9ec32e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion client/include/states/GameState.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class GameState : public gk::ApplicationState {

gk::Shader m_shader;

gk::Camera m_camera{FOV, DIST_NEAR, DIST_FAR};
gk::Camera m_camera{70.0f, DIST_NEAR, DIST_FAR};
ClientPlayer m_player{m_camera};

Client m_client;
Expand Down
3 changes: 3 additions & 0 deletions client/source/states/GameState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ void GameState::onEvent(const SDL_Event &event) {
void GameState::update() {
m_world.update();

if (m_camera.getFieldOfView() != Config::cameraFOV)
m_camera.setFieldOfView(Config::cameraFOV);

if (m_clientCommandHandler.isRegistryInitialized()) {
if (&m_stateStack->top() == this) {
m_player.processInputs();
Expand Down
3 changes: 1 addition & 2 deletions common/include/core/Config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ namespace {
constexpr float SCREEN_WIDTH = 1600;
constexpr float SCREEN_HEIGHT = 1050;

constexpr float FOV = 45.0f;

constexpr float DIST_NEAR = 0.1f;
constexpr float DIST_FAR = 1000.0f;

Expand All @@ -47,6 +45,7 @@ namespace Config {
extern bool isAmbientOcclusionEnabled;
extern bool isWireframeModeEnabled;
extern u16 renderDistance;
extern float cameraFOV;
}

#endif // CONFIG_HPP_
1 change: 1 addition & 0 deletions common/source/core/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ bool Config::isSunSmoothLightingEnabled = true;
bool Config::isAmbientOcclusionEnabled = false;
bool Config::isWireframeModeEnabled = false;
u16 Config::renderDistance = 8;
float Config::cameraFOV = 70.0f;

0 comments on commit b9ec32e

Please sign in to comment.