Commit Graph

309 Commits

Author SHA1 Message Date
289c456428 Now VoxelChunkDefault can create area colliders aswell, liquids are created using these in the running game. (Only there because the editor needs raycasting.) Also fixed setting liquid visibility. 2020-04-20 01:01:24 +02:00
6e9a952a2a Implemented liquid meshing. 2020-04-20 00:31:46 +02:00
21ad01ca80 Removed separate liquid surfaces. They will be contained inside the normal voxel arrays. 2020-04-19 23:35:47 +02:00
4a2321b161 Some settings in world will now get distributed to chunks. is_build_threaded has been moved from coxel chunk default to voxel chunk. ALso fixed a few crashes. 2020-04-18 02:15:01 +02:00
23d9acb5d4 Ported the lod level updater code from broken seals. 2020-04-17 22:09:55 +02:00
2d5b9ed029 Removed build_deferred, and build_prioritized methods from the default chunk. 2020-04-17 20:24:50 +02:00
bee499d951 The library now has an initialized bool. Also the world editor will refresh rects in the library if needed. 2020-04-17 19:21:46 +02:00
c382dac3ff Added a new tool to the world editor, it adds a block to the location of the spatial editor's camera. 2020-04-17 18:36:14 +02:00
5c0ab27715 Added 3 more helper functions to voxel world. 2020-04-17 10:15:50 +02:00
9cdd107565 Added the surface lists into scroll containers. Also text is now aligned to the left on the buttons. 2020-04-17 02:39:23 +02:00
35863196d7 Now the world editor will use the channel reported by world's get_channel_index_info. Also it now has support for liquid channels (based on the currently selected tab). 2020-04-17 02:09:24 +02:00
f43e4a2cc4 Implemented add and remove tool mode selectors in world editor. Also added shortcuts (a, s). 2020-04-17 01:52:16 +02:00
7c0390de74 The air block is not required anymore. Also Implemented the sidebar for world editor. And fixed a naming error for a virtual method in the merger library. 2020-04-17 00:37:22 +02:00
76f9011c24 Added an overrideable fonction to VoxelWorld, so the editor plugin will be able to query the correct channel ids, for any particular world. returning -1 will mean not supported. 2020-04-16 21:59:30 +02:00
b21030ae89 More const qualifiers. 2020-04-16 17:54:32 +02:00
367c203cc6 Added lots of const qualifiers to world and chunk. 2020-04-16 17:10:04 +02:00
135b34c8a8 Moved the chunk position calculations from the world editor into VoxelWorld. 2020-04-16 14:44:22 +02:00
06d3b0ae32 Add property for voxel structures. 2020-04-16 14:07:10 +02:00
d985610574 Cleaned up VoxelStructure, and added an api for them into VoxelWorld. 2020-04-16 13:40:39 +02:00
dd0fa1d7ea Cleaned up the prop spawning api in chunk and world. 2020-04-15 13:06:45 +02:00
a63ae2183a Removed _THREAD_SAFE_CLASS_ from VoxelChunk as its not used aywhere right now. 2020-04-15 12:44:16 +02:00
7a3e4ecbe3 Cleaned up the light baking api. 2020-04-15 12:41:52 +02:00
c752086bdd A bit more work on the world editor. 2020-04-10 16:28:33 +02:00
fd24639e26 The world editor now won't use right click, as it makes navigation awful. 2020-04-10 16:13:04 +02:00
acf2d2d701 Fix 2 multithreading related crashes. 2020-04-10 15:50:53 +02:00
1f23f61b3a Ran clang format, as apparently I had it off. 2020-04-10 13:55:27 +02:00
01c57c30e6 Fix error when the data margins are 0. 2020-04-10 13:43:49 +02:00
17dfbb4cab Fix voxel index calculations in the world editor. 2020-04-10 13:40:07 +02:00
03f9041eb8 Added get_or_create_chunk to VoxelWorld. 2020-04-10 13:39:11 +02:00
a722f807fe Fix building for 3.2. 2020-04-09 15:45:51 +02:00
073e1aeb97 Fix build for 4.0. 2020-04-09 12:34:39 +02:00
9fe51572f4 Didi the same optimization to the transvoxel uv mesher. 2020-04-07 14:40:35 +02:00
f7842e1ab2 The blocky mesher is a lot faster now. 2020-04-07 14:23:20 +02:00
a4fc573f85 Optional module dependencies are actually optional now. 2020-04-06 22:47:03 +02:00
8b78f8e91d Library should update it's rects even in the editor now. 2020-04-06 20:10:57 +02:00
4a535207e0 Now chunks will generate the collider in the spawned thread. Also a few smaller tweaks. 2020-04-06 20:05:19 +02:00
f63a8910dc Fix coord calculation for the editor plugin. 2020-04-06 19:46:17 +02:00
c691c13277 Added a _chunk_added virtual method to voxel world. 2020-04-06 13:55:22 +02:00
b4c61ac674 Created a default version from world, and the mesher. Also added a BuildFlags enum to VoxelChunkDefault. Converted a few properties to use this. 2020-04-06 13:41:45 +02:00
d717c9886b Fix set_chunks, and enter_tree. 2020-04-06 00:51:25 +02:00
b046db78ed Removed leftover print. 2020-04-05 22:56:40 +02:00
25da88da19 Add the ability to get or set a channel compressed. 2020-04-05 22:07:52 +02:00
98707674a4 Initial implementation for the voxel world editor. 2020-04-05 21:02:51 +02:00
d36eff4ed3 Fix potential crash. 2020-04-05 02:08:08 +02:00
b7f3b59f54 Removed the mutex from build phase. 2020-04-05 01:47:14 +02:00
dfee0a7786 Added a blocky mesher, chunk, and world (The minecraft-style mesher). It's incomplete. Also ported the light baking step from Broken Seals, and fixed a few warnings. 2020-04-05 01:36:41 +02:00
2d2b7c8c3e Started reworking the way props are handled. Removed every old PropData related classes. Props are now just normal PackedScenes. Spawning conveniences/network synchronization will come later. 2020-04-04 17:22:07 +02:00
214323a9a0 Fix compile. 2020-04-03 09:32:34 +02:00
bf211fd430 Moved everything that is prop related to a new repository (props). It is required for this to compile for a short wile, while I rework things. 2020-04-03 09:25:07 +02:00
6cae9a0494 Set the property hint for voxel_world to 0. This fixes saving chunks as resoruces. 2020-04-02 21:38:19 +02:00
9da5d2e2d0 VoxelChunk now inherits from Resource instead of from Spatial. This is to make the scene cleaner (especially after I implement the world editor plugin). As a small bonus this should also make multithreading-related crashes harder to create, as manipulating the Scenetree from a thread by accident is now a lot harder. 2020-04-02 21:28:19 +02:00
599b3eb8ea Fixed 2 warnings. 2020-03-31 13:32:06 +02:00
f7fd0193ea Added an editable property to VoxelWorld, and made the world editor plugin make use of it. 2020-03-31 13:25:31 +02:00
dfafb23342 VoxelChunk now won't expose the channels for the editor. This functionality should be implemented per chunk implementation. Did not delete the code yet, just commented it out. 2020-03-31 12:42:22 +02:00
3969e0ba5f Fix a multithreading related crash. 2020-03-30 23:15:23 +02:00
f26fe74fc4 Ported the lod implementation from Broken Seals. 2020-03-30 19:46:39 +02:00
393ee1fb1b DefaultVoxelChunk now has a general interface for storing mesh/collider RIDs. 2020-03-30 18:32:39 +02:00
ee03e42a5a Fix assign. 2020-03-30 14:57:07 +02:00
4691e2aaef Ported merge_mesh_array and merge_mesh_array from Broken Seals. 2020-03-30 14:36:49 +02:00
4a3c9836ff Made the default visibility change event overrideable in VoxelChunkDefault. 2020-03-29 23:55:40 +02:00
541abb954d Now materials in Library are stored with vectors. This makes it possible to have different materials for every lod level for example. 2020-03-29 20:19:38 +02:00
ddfdb4489f Missed a binding. 2020-03-24 18:44:17 +01:00
87d387388c Apparently, calling emit signal and set_process_internal form a separate thread is not smart. 2020-03-24 18:42:01 +01:00
d0578c24d4 Separated VoxelStructure into 2 classes, and made it scriptable. 2020-03-19 13:08:58 +01:00
666695a220 Now VoxelChunkDefault will move it's meshes if it's transform changes, free them on EXIT_TREE, and sets their visibility. Also added a few missing break statements. 2020-03-15 19:33:10 +01:00
080e8f2437 Broke up VoxelChunk into VoxelChunk and VoxelChunkDefault. 2020-03-12 23:23:38 +01:00
29b77a3a6d Finished up the rework I started in the prevoius commit. 2020-03-06 21:09:13 +01:00
90cbfe02cc started reworking how chunk handles threaded builds. 2020-03-06 16:12:39 +01:00
8f71179c5e More work on Chunk's threading. 2020-03-06 15:39:55 +01:00
370e14f6c8 Removed the temp mesh array I just added from voxel chunk. 2020-03-06 14:27:04 +01:00
656f0ba9fa build_phase() and _build_phase() in Chunk now won't return/need to return a value, as get_build_phase_done() is equivalent. Also now chunk building is actually threaded, as it seems like I managed to remove thread creation in one of the refactor commits. Also fixed a few smaller issues/inconsistencies. 2020-03-06 14:22:04 +01:00
d08da0375a Better way of handling the previous improvement. It will actually work now properly aswell. 2020-03-04 20:49:00 +01:00
f9d13c611f Improved aborting chunk build. 2020-03-04 20:12:15 +01:00
59291a9417 Fix math in is_position_walkable. 2020-03-04 18:35:09 +01:00
fbd2903477 Added is_position_walkable query to World, also a few related things. 2020-03-04 15:21:32 +01:00
dec4fcd402 Added get_max_frame_chunk_build_steps to be able to limit the chunk build steps launched per frame. Also a few smaller improvements. 2020-03-04 14:59:34 +01:00
d431ca4daa Added index-based remove chunk function, also fixed remove_chunk, now it properly removes the given chunk from the chunk map. 2020-03-04 10:48:53 +01:00
e45e3875f8 Setup for a new VoxelWorldEditor. 2020-02-27 14:27:52 +01:00
d85187b6a8 Removed stray files. 2020-02-27 13:43:46 +01:00
36063410f9 Hide saved channels in the editor, and from scripts. 2020-02-26 12:22:46 +01:00
3e98b8e01c Added a few properties to chunk, so they can be saved into PackedScenes if needed. 2020-02-26 01:08:18 +01:00
5b32345181 Fleshed out VoxelStructure's api. 2020-02-23 22:09:45 +01:00
f25dac92ea Started reworking VoxelStructure's api. 2020-02-21 10:42:51 +01:00
6c39845387 Removed a few now unneeded methods from VoxelChunk, they got merged into _build_phase. Also added build_mesh_into to VoxelMesher, it's equivalent to the old build_mesh. 2020-02-20 13:44:38 +01:00
8b734eec11 Mesher's build_mesh function now has no argument, and returns an array. 2020-02-20 13:19:54 +01:00
509d45a662 build_phase() in VoxelChunk should be thread safe. 2020-02-16 16:18:41 +01:00
07afd06c2a Now chunks can properly use multiple meshers at the same time. 2020-02-14 19:02:31 +01:00
a457ed400c Added data margin start, and end property to VoxelWorld for easy access. Improved set_voxel, and get_voxel in VoxelChunk to accomodate for margins as originally intended (e.g. if start_margin is 1, indexes go from -1 to size + end margin). Fixed/updated indexing in VoxelMesherCubic. 2020-02-14 03:19:15 +01:00
3a8310c51f More improvements to chunk's threading logic. Also removed the build_phase_done function I added a few hours ago, and made build_phase return a bool (true if the phase is completed, false if not), essentially achieving the same effect. 2020-02-12 20:34:16 +01:00
8a2524dc57 Improved multithreading a lot, it doesn't seem to crash anymore. Also made chunk mesh generation faster by letting build phases run one after an another without launching new threads (using is_phase_threaded). 2020-02-12 14:16:31 +01:00
fd1ff4b4ff Better chunk building setup. And smaller fixes and tweaks. 2020-02-10 23:39:57 +01:00
db77530ec1 Updated the license for 2020, and added it to the top of my cpp files. 2020-01-31 19:52:37 +01:00
01bb492760 Merge branch 'meshers' 2020-01-13 00:40:10 +01:00
104a307d55 Now Chunk has a vector of meshers, this simplifies for example liquid meshing, and this allows combining multiple meshers. Also the number of build phases is settable. 2020-01-13 00:39:55 +01:00
c0c0fa403c Fix a typo in Chunk's bindings. 2020-01-12 21:58:23 +01:00
a67d0393ca Clang format. 2020-01-09 04:29:05 +01:00
8e02dcb9e8 Fix build. 2019-12-24 03:22:17 +01:00
ce4020962e Now the mesher will set the material for the generated meshes directly, also it sets the material as surface material instead of an override material. 2019-12-03 19:22:04 +01:00
edec04cfdc Chunk now supports threaded builds. Also small fixes. 2019-11-19 20:39:45 +01:00
a377c994e9 Fixes. 2019-11-19 19:14:46 +01:00
ffb154a4fe More work. 2019-11-19 16:42:38 +01:00
1003a393e6 More work. 2019-11-19 16:33:06 +01:00
d2566ab82b gdscript->c++ conversions. 2019-11-19 14:42:21 +01:00
0594215929 Seemingly the bindings are done. Also added a new chunk build phase. 2019-11-19 00:54:28 +01:00
7885d49949 Implemented chunks's new functionality, and work on the bindings. 2019-11-18 23:50:06 +01:00
5bfe5e7905 Fixed linker errors aswell. 2019-11-18 22:40:58 +01:00
d5acb28a90 More work on fixing compile. 2019-11-18 22:22:41 +01:00
9103db635f More work on compile. 2019-11-18 21:53:33 +01:00
b60b8a96d6 More work on the build, and more api breakages. 2019-11-18 20:16:29 +01:00
f00933bb71 More work on fixing the build. 2019-11-18 20:03:40 +01:00
decf9a4af2 Work on the interface, and build. 2019-11-18 19:43:15 +01:00
5b275155c5 Removed the classes that I got from the other voxel module. Moved the stuff that I wrote from VoxelBuffer to VoxelChunk. I'll reimplement the needed stuff myself into the chunk. 2019-11-18 19:22:11 +01:00
d8035c86e9 VoxelBuffer now stores it's actual size separately. 2019-11-17 03:25:46 +01:00
5e5d95aac5 Added margin to VoxelBuffer. 2019-11-17 02:17:40 +01:00
e0deb2ea66 Added liquid, and clutter mesh allocations into Chunk, also related modifications. 2019-11-10 13:42:59 +01:00
c674a8c045 Added chunk states, and dirty flag to Chunk. 2019-11-10 03:10:42 +01:00
f0cd4008fc Added WorldArea. 2019-11-10 01:03:48 +01:00
7ee2017568 Added 2 more build phases. 2019-11-09 23:43:29 +01:00
3b722e24f9 Added binds for liquids. 2019-11-09 23:39:19 +01:00
8bbc6da5d2 Now PropData can add lights into chunks. 2019-11-08 11:52:36 +01:00
2c49d2e8d9 Renamed VoxelmanProp to PropData. 2019-11-07 21:32:31 +01:00
033fe750c0 Updated the color baking algorithm, and restructured build phases. 2019-11-06 17:43:51 +01:00
f23f3122a4 Better snap axis defaults. 2019-11-06 13:44:22 +01:00
3f7b422662 VoxelChunk is s Spatial now (again). 2019-11-06 03:37:22 +01:00
440b4eadfb Added a Texture property to VoxelChunkPropData aswell. 2019-11-05 21:27:31 +01:00
8e4e65371d Typo fixes. 2019-10-16 00:50:30 +02:00
472b077d3f Added a "_prop_added" vmethod to Chunk. 2019-10-14 23:59:42 +02:00
fd3a162126 Reworked the way chung handles props, and made chunk building fully scriptable. 2019-10-10 23:51:05 +02:00
cf9e3e8f19 Added an EnvironmentData class. 2019-10-07 22:22:47 +02:00
0175490bc5 Now VoxelWorld inherits from Navigation. 2019-10-05 22:53:48 +02:00
aa4fb6c088 Implemented the remaining stub methods for voxel structure. 2019-09-25 11:30:07 +02:00
56ce70f025 Work on VoxelStructure. 2019-09-25 01:49:35 +02:00
4d24c13e91 Added VoxelStructure skeleton class. 2019-09-24 02:05:40 +02:00
306dc575d8 Improved the way props work. 2019-09-22 02:46:21 +02:00
916676cfab Renamed VoxelPropData, and cleaned up VoxelProp bit. 2019-09-21 00:02:10 +02:00
5eb5249147 Level generator skeleton class. 2019-09-03 13:52:32 +02:00
34e109a54b Moved more properties. 2019-08-12 20:40:05 +02:00
b0dc290c20 Started moving common things in VoxelWorld to c++. 2019-08-12 13:12:42 +02:00
78581077f7 Added a new random ao channel. 2019-08-08 21:09:55 +02:00
de3f60d3f4 Added a new method to VoxelChunk. 2019-08-03 23:17:19 +02:00
a633808274 Renamed free to free_chunk, as it collided with Object's free(). 2019-08-01 01:05:09 +02:00
9b842c159a -Moved the basic mesh color baking into the base VoxelMesher, as well as the 2 light specific parameters.
-Added a binding from the AO VoxelBuffer enum value.
-Renamed back draw_debug_voxels_colored to draw_debug_voxels.
2019-07-24 02:14:02 +02:00
47f3fa2a7f Now the props use transforms internally, instead of vectors. And improved the design a bit. 2019-07-20 14:48:56 +02:00
c29c74b1d9 More work oncleaning up the interface of the VoxelChunk. I'ts mostly okay, but might need to change a bit more. Also added a few const keywords where I found them missing. 2019-07-19 23:54:56 +02:00
4ad2faca86 Started reworking the mesher, and the cunk's interface. 2019-07-19 20:54:09 +02:00
029f241005 Implemented props. 2019-07-18 18:56:42 +02:00
7e7c07cbd8 VoxelChunk is a Reference now. 2019-07-18 02:05:50 +02:00
9c036f0706 Now VoxelChunk uses the VisualServer, and PhysicsServer directly. 2019-07-18 01:43:58 +02:00
7db42b88a1 Now the base light value is settable in the Cubic Voxel Mesher. 2019-07-17 19:51:09 +02:00
469773a9fd Fixed the voxel mesher, and converted it to c++. Also small bugfixes, and binding improvements. ALso moved a few export variables from GDscript to bindings. 2019-07-17 17:01:12 +02:00
e4e38c0bde Work on lights, and cleanups. 2019-07-17 02:28:16 +02:00
7f0a832677 Implemented Ao generation, and started working on light support. 2019-07-16 16:18:09 +02:00
71de54d9a0 Now voxelman can actually make meshes. 2019-06-08 19:47:17 +02:00
b50c9be4e7 More cleanup, and fixed a misunderstanding. 2019-06-08 01:28:39 +02:00
ba05f93aa2 -Removed Voxel, not needed.
-Huge cleanup.
-Moved the voxel query to a new folder, also it's not in the build anymore. Will be removed shortly.
2019-06-07 19:13:07 +02:00
9fb6a4e1c1 Progress on getting voxelman to work again, also cleanups. 2019-06-07 01:33:41 +02:00
b5bdecf95a Added VoxelBuffer to the build. 2019-05-31 23:57:56 +02:00
e2c8c5c2ca Added in 2 more classes and the updated vector3i from https://github.com/Zylann/godot_voxel. Also added their license to the top of these files. 2019-05-31 23:28:33 +02:00
4d73c7e9c6 Added in gridmap from godot, I currently think it is a nice place to start from with the voxel world, as it pretty much already works like it, and it has a nice editor plugin as well. Also I haven't yet used godot's servers too much. 2019-05-31 23:03:38 +02:00