650 Commits

Author SHA1 Message Date
Quentin Bazin
bcc3f65147 Headers updated and CONTRIBUTORS file added. 2020-02-25 01:48:38 +09:00
Pedro Gimeno
ead6df00f6 Revert to negative angle, as it's causing issues
Look into that later.
2020-02-24 17:06:27 +01:00
Pedro Gimeno
4f37012931 Camera improvements
- Remove the degenerate case of vertical directions, by updating the viewup as the camera moves.
- Remove the consequent limitation to 89.9 degrees.
- Add (unused so far) camera roll angle, with setter.
- Add accessors for all angles. Lua will want to know that.
- Rename m_angleV/H to m_viewAngleV/H to distinguish them clearly from the orientation of the mesh. They will differ e.g. when the player is sitting somewhere.
- Rename vertical turn so it includes 'view' in the name, because this one does not affect the player's rotation as turnH does.
- Make player look north at start, like it originally did before the Z-up changes.
2020-02-24 17:06:27 +01:00
Quentin Bazin
4fc45e3d93 [GameState] The game will now be paused it the window lose the focus. 2020-02-24 23:23:27 +09:00
Quentin Bazin
7e38907854 [SettingsMenuState] It's now possible to disable VSync. 2020-02-24 23:16:51 +09:00
Quentin Bazin
7c9b72b137 [Config|SettingsMenuState] Added option to disable BlockInfoWidget. 2020-02-24 22:43:31 +09:00
Pedro Gimeno
6e506d8500 Precision improvements (Part 5)
Get rid of floats when calculating chunk position from block position. This can be done in integers. Since CHUNK_WIDTH etc. are guaranteed to be powers of two, using & -N is equivalent to doing & ~(N-1), or put differently, making it divisible by N. That makes the division exact, and allows the compiler to transform it into a plain shift (tested with both gcc and clang).

We did the same in Part 3 of this series.
2020-02-24 12:00:02 +01:00
Pedro Gimeno
d4daaa6355 Precision improvements (Part 4)
Fix world generator (to some extent).
2020-02-24 12:00:02 +01:00
Pedro Gimeno
33dca07ee0 Precision improvements (Part 3)
Fix debug overlay.
2020-02-24 12:00:02 +01:00
Pedro Gimeno
6e3c2e066f Precision improvements (Part 2)
Improve player precision, especially location, but also rotation.
2020-02-24 11:59:53 +01:00
Pedro Gimeno
4bb12c872f Precision improvements (Part 1)
Improve rendering precision by subtracting the camera position from the models' position, then temporarily setting the camera to (0, 0, 0) for rendering. This keeps GL coordinates in a low range.
2020-02-24 11:16:19 +01:00
Pedro Gimeno
af1a641a25 Fix calculation of centre position relative to the camera
While this fixes the calculation, it introduces visibility determination problems, because the method was not correct. The centre may be out of the area of the camera, with nodes still visible inside. To fix this, the eight corners of the chunk need to be considered.
2020-02-24 11:16:19 +01:00
Quentin Bazin
75f9bc6dbd [ClientWorld] Teleportation and fast movement won't stop the world from loading. Fixes #50. 2020-02-24 18:53:21 +09:00
Pedro Gimeno
040c8d5d07 Fix waving vertex shader
It's everything commented out so it technically works, but this way it's ready for the time when it's enabled again.
2020-02-24 10:38:08 +01:00
Pedro Gimeno
22ecc2fa8d Fix 'escape from inside node' after Y/Z swap
Missed the case of getting rid of the box at the southwest.

We take the chance for making it more robust by checking all four corners, just in case there's a platform with trouble in an edge case.
2020-02-24 10:38:08 +01:00
Pedro Gimeno
8c5ab63061 Change server-side player position to match the client-side one 2020-02-24 10:38:08 +01:00
Quentin Bazin
47d57f7fc3 [ServerCommandHandler] Now deletes ServerPlayer instance on disconnection. 2020-02-24 17:20:49 +09:00
Quentin Bazin
879dc28eb2 [FurnaceWidget] Removed. Now completely implemented in Lua. 2020-02-23 22:38:51 +09:00
Quentin Bazin
4eb3e3738f [ProgressBarWidget] Added. 2020-02-23 20:42:32 +09:00
Quentin Bazin
47b7e3d849 [PlayerCraftingWidget] Removed, implemented completely using Lua. 2020-02-23 18:24:19 +09:00
Quentin Bazin
3399b71de1 [LuaWidgetDef] Added 'resultX' and 'resultY' parameters to 'CraftingWidget' and 'PlayerCraftingWidget'. 2020-02-23 18:00:20 +09:00
Quentin Bazin
e5de3669a7 [screenshot1] Updated. 2020-02-23 15:38:43 +09:00
Quentin Bazin
904152e1aa [PlayerInventoryWidget] Removed, only PlayerCraftingWidget isn't coded in Lua. 2020-02-22 22:50:27 +09:00
Quentin Bazin
3cffbc9547 [ChatState] Can now be opened with a slash by using numpad slash. 2020-02-22 03:44:12 +09:00
Quentin Bazin
884562cb36 [Client] Handles disconnection correctly now. 2020-02-22 02:56:55 +09:00
Quentin Bazin
88f3fc1475 [ServerCommandHandler] Now send an error message when a wrong command has been recieved. 2020-02-22 02:21:42 +09:00
Quentin Bazin
cac41afdfa [GameState] Now uses GameKey::Chat instead of hardcoded keycode. 2020-02-22 02:16:19 +09:00
Quentin Bazin
2724cb0522
Merge pull request #57 from Unarelith/chat-and-commands 2020-02-22 01:48:43 +09:00
Quentin Bazin
bb0c8e8d49 [ServerCommandHandler] Now supports teleportation command. 2020-02-22 01:44:00 +09:00
Quentin Bazin
3c4fae07f5 [Text] Added the possibility to cut a line in the middle if it's too long. 2020-02-22 01:00:42 +09:00
Quentin Bazin
ec15fec087 [ChatMessage] Added. Messages now have timeout. 2020-02-22 00:31:11 +09:00
Quentin Bazin
087d430acb [TextInput] Moved background and padding to Text. 2020-02-21 23:58:15 +09:00
Pedro Gimeno
4b725b8db3 Fix some issues with the comparison of varying variables 2020-02-21 12:22:28 +01:00
Pedro Gimeno
832b8d1cb0 Add comment about needing to be in sync 2020-02-21 12:04:08 +01:00
Pedro Gimeno
fc08f84151 Remove special lighting of flowers
It was affecting grass too.
2020-02-21 12:01:47 +01:00
Pedro Gimeno
a89f0dbb1d Map face numbers in the shader as well 2020-02-21 11:42:12 +01:00
Pedro Gimeno
7c8c77d7b9 Change order of enum BlockFace for consistency with Chunk.hpp 2020-02-21 11:02:53 +01:00
Pedro Gimeno
14de0d8e9f Change vertices array to 2D 2020-02-21 11:02:53 +01:00
Pedro Gimeno
9016dab8a1 Create a mapping to determine texture index from array size/face 2020-02-21 11:02:29 +01:00
Quentin Bazin
e08af87563 [Chat] Added to render messages sent from server. 2020-02-21 17:50:45 +09:00
Quentin Bazin
2f827df14b [Network] 'ChatMessage' packet added. 2020-02-21 17:25:56 +09:00
Quentin Bazin
676f0937ec [ChatState] TextInput is now positionned correctly. 2020-02-21 16:33:52 +09:00
Quentin Bazin
8b906d1685 [TextInput] Fixed background. [InterfaceState] Added setting to be able to not display the background. 2020-02-21 16:33:52 +09:00
Quentin Bazin
2ecbdec6bb [ChatState|TextInput] Added. 2020-02-21 16:33:52 +09:00
Quentin Bazin
530355cb39 [TerrainGenerator] Changed to get back old cave gen. [ClientPlayer] Spawn pos changed. 2020-02-21 16:33:18 +09:00
Pedro Gimeno
2a8125a979 Use Z for up (Part 6)
Fix neighbouring chunks list on the server side, which was causing some slices of trees to appear in the air.

Also switch order of loops for generating leaves to Z, Y, X.
2020-02-21 03:00:53 +01:00
Pedro Gimeno
c8b5d946a6 Use Z for up (Part 5)
Fix other players' box
2020-02-21 03:00:53 +01:00
Pedro Gimeno
5ced7d70d8 Use Z for up (Part 4)
Fix chunk visibility test and visibility of world at start.

The assumptions about the working of screen coordinates in the previous commit were clearly wrong.
2020-02-21 03:00:53 +01:00
Pedro Gimeno
9a1b193be9 Use Z for up (Part 3)
Fix camera, player movement, and bounding boxes.
2020-02-21 03:00:27 +01:00
Pedro Gimeno
76071d9f26 Use Z for up (Part 2)
Fix UVs and ambient occlusion maps. The change of chirality was not enough, as that rotated faces, so that needed to be fixed. This affected vertex indices that were manipulated by the AO algorithm, which needed to be fixed as well.
2020-02-20 23:26:15 +01:00