[GameState] Now using a 70° FOV.

This commit is contained in:
Quentin Bazin 2020-01-25 15:29:14 +09:00
parent 758f55647e
commit b9ec32ec71
4 changed files with 6 additions and 3 deletions

View File

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

View File

@ -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();

View File

@ -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;
@ -47,6 +45,7 @@ namespace Config {
extern bool isAmbientOcclusionEnabled;
extern bool isWireframeModeEnabled;
extern u16 renderDistance;
extern float cameraFOV;
}
#endif // CONFIG_HPP_

View File

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