]> git.localhorst.tv Git - blank.git/blobdiff - src/client/client.cpp
chat state
[blank.git] / src / client / client.cpp
index 97292a957f86466a228dbd24f1c45e28a20aae85..455550afeccc27500120409a1b8162be50a5fdc6 100644 (file)
@@ -147,7 +147,9 @@ void InteractiveState::Update(int dt) {
 }
 
 void InteractiveState::Render(Viewport &viewport) {
-       viewport.WorldPosition(player.GetEntity().Transform(player.GetEntity().ChunkCoords()));
+       viewport.WorldPosition(
+               player.GetEntity().Transform(player.GetEntity().ChunkCoords())
+               * player.GetEntity().GetModel().EyesTransform());
        if (master.GetConfig().video.world) {
                chunk_renderer.Render(viewport);
                world.Render(viewport);
@@ -380,6 +382,8 @@ void MasterState::On(const Packet::Join &pack) {
        state.reset(new InteractiveState(*this, player_id));
 
        pack.ReadPlayerState(state->GetPlayer().GetEntity().GetState());
+       glm::vec3 orient(glm::eulerAngles(state->GetPlayer().GetEntity().Orientation()));
+       state->GetPlayerController().TurnHead(orient.x, orient.y);
 
        env.state.PopAfter(this);
        env.state.Push(state.get());