diff --git a/src/client/player.cpp b/src/client/player.cpp index b06da5ef2..6e5352685 100644 --- a/src/client/player.cpp +++ b/src/client/player.cpp @@ -61,13 +61,16 @@ void Player::move(const World& world) { } void Player::rotationMove() { + static bool rotationInteria = getJsonValue(getSettings()["gui"]["rotation_interia"], false); + if (mRotation.x + mRotationSpeed.x > 90.0) mRotationSpeed.x = 90.0 - mRotation.x; if (mRotation.x + mRotationSpeed.x < -90.0) mRotationSpeed.x = -90.0 - mRotation.x; mRotation += mRotationSpeed; mRotationDelta = mRotationSpeed; - mRotationSpeed *= 0.6; + if(rotationInteria) mRotationSpeed *= 0.6; + else mRotationSpeed = 0; } Player::Player(size_t worldID) : PlayerObject(worldID) { diff --git a/src/gui/gamescene.cpp b/src/gui/gamescene.cpp index 7c31baa19..02955b783 100644 --- a/src/gui/gamescene.cpp +++ b/src/gui/gamescene.cpp @@ -25,9 +25,9 @@ #include "renderer/blockrenderer.h" #include -class PlayerControllerTask : public ReadOnlyTask { +class PlayerUpdateTask : public ReadOnlyTask { public: - PlayerControllerTask(Player& player) : mPlayer(player) {} + PlayerUpdateTask(Player& player) : mPlayer(player) {} void task(const ChunkService& cs) override { @@ -62,11 +62,10 @@ class PlayerControllerTask : public ReadOnlyTask { #endif mPlayer.accelerate(Vec3d(0.0, -2 * speed, 0.0)); - // mGUIWidgets.update(); } - std::unique_ptr clone() override { return std::make_unique(*this); } + std::unique_ptr clone() override { return std::make_unique(*this); } private: Player& mPlayer; @@ -114,7 +113,7 @@ GameScene::GameScene(const std::string& name, const Window& window): mCurrentWorld->registerChunkTasks(chunkService, mPlayer); mWorldRenderer.registerTask(chunkService, mPlayer); chunkService.getTaskDispatcher().addRegularReadOnlyTask( - std::make_unique(mPlayer)); + std::make_unique(mPlayer)); chunkService.getTaskDispatcher().addRegularReadOnlyTask( std::make_unique(mUpsCounter)); @@ -178,7 +177,7 @@ void GameScene::render() { // Camera control by mouse static const double mouseSensitivity = - getJsonValue(getSettings()["gui"]["mouse_sensitivity"], 0.2); + getJsonValue(getSettings()["gui"]["mouse_sensitivity"], 0.3); MouseState mouse = Window::getInstance().getMouseMotion(); mPlayer.accelerateRotation(Vec3d(-mouse.y * mouseSensitivity, -mouse.x * mouseSensitivity, 0.0));