Commit Graph

42 Commits (0e48ee71a4fb72a4fcb20eb7ce099747afc4ae85)

Author SHA1 Message Date
Marc Gilleron c0cb82888e Changed run_blocky_random_tick so it respects its given area instead of somehow snapping it 2022-01-06 22:06:43 +00:00
Marc Gilleron 1d63067b6b Re-namespaced VoxelToolOps 2022-01-03 23:33:29 +00:00
Marc Gilleron e20684ce69 Namespaced math funcs 2022-01-03 23:14:18 +00:00
Marc Gilleron 82e9625bc8 Namespaced voxel_raycast() 2022-01-03 02:59:15 +00:00
Marc Gilleron 922f361cb0 Made it compile in Godot 4
- Made a bunch of changes to comply with Godot 4 API
- Use Godot's Vector3i and add the missing stuff with helper functions
- Transvoxel uses custom attributes API, the old way would not work
- Wrap MeshOptimizer in a unique namespace (see build script why)
- Added clang-format file for the module as some rules now differ
- Prevent thirdparty code and lookup tables from being clang-formatted
- Very likely full of runtime bugs that need fixing
2021-12-13 21:38:10 +00:00
Marc Gilleron ca7ac42cde Merge branch 'master' into full_load_mode
# Conflicts:
#	edition/voxel_tool_lod_terrain.cpp
#	generators/graph/voxel_generator_graph.cpp
#	terrain/voxel_lod_terrain.cpp
2021-10-31 16:17:27 +00:00
Marc Gilleron 6441d1b864 Deprecate Vector3i(Vector3) constructor, make conversions explicit
Some conversions were wrong/unintented.
This is also in prevision of using Godot 4 Vector3i,
which default behavior differs from this module.
2021-10-31 16:01:47 +00:00
Marc Gilleron 3133834a17 Check AABB size before using it 2021-10-27 19:49:37 +01:00
Marc Gilleron c5b0ac43fb Semi-async do_sphere() implementation. May change though.
It is a lot better than the fully synchronous do_sphere(),
but it would be a lot better if we could move everything async
2021-10-04 19:20:36 +01:00
Marc Gilleron a107e5f076 Fix enum comparisons (2) 2021-09-26 17:36:56 +01:00
Marc Gilleron 00d6190d3c Old comment 2021-09-26 17:20:43 +01:00
Marc Gilleron 30db0c5193 Split VoxelBuffer in two, script-facing wrapper and internal.
The internal is the main use within the voxel engine,
and does not inherit Reference.
2021-09-26 04:14:50 +01:00
Marc Gilleron 979e5c9c47 VoxelTool.paste now only expects 0xffffffff to turn off masking.
Before it was 0xffffffffffffffff, which the GDScript parser no longer
accepts because it is greater than INT64_MAX.
In the future we may rework this API.
2021-09-24 02:09:58 +01:00
Marc Gilleron bd696b4caa Functions that should be const 2021-09-09 18:52:00 +01:00
Marc Gilleron 7cb1e4008e Use accessor 2021-08-15 17:27:55 +01:00
Marc Gilleron c2248f9254 I don't remember why this was padded 2021-06-16 23:33:58 +01:00
Marc Gilleron 19f440527e Implemented VoxelToolTerrain.for_each_voxel_metadata_in_area 2021-06-16 23:31:00 +01:00
Marc Gilleron 1ee5bcb80d Renamed Rect3i -> Box3i 2021-05-31 17:12:04 +01:00
Marc Gilleron 74e89b882e Implemented texture painting on all VoxelTools using faster access to voxels 2021-05-29 23:28:11 +01:00
Marc Gilleron 0dc6702308 VoxelToolTerrain.raycast now accounts for scale and rotation, and supports VoxelMesherCubes with non-zero values 2021-05-16 04:29:08 +01:00
Marc Gilleron 9b3263d68b Fix copy 2021-05-15 16:31:36 +01:00
Marc Gilleron d53e7dd530 Fixed several bugs related to VoxelTool::paste()
- One of the Rect3i constructors was wrong
- Rewrite clipping logic of VoxelBuffer::copy_from
- Fix VoxelDataMap::paste to provide correct offsets
- Fix meshing data copy to account for clipping adjustments
2021-05-07 18:38:02 +01:00
Marc Gilleron 1449560f29 Implemented decoupling on VoxelTerrain (no setter yet) 2021-04-13 23:48:35 +01:00
Marc Gilleron 09c815e253 Implemented `copy` and `paste` for VoxelToolTerrain (untested) 2021-02-21 18:23:56 +00:00
Marc Gilleron b51897b8df Added voxel raycast to VoxelToolLodTerrain
- Made more precise with an option to use binary search (unoptimized)
- Distance along ray is now available in blocky terrains as well
2021-02-21 03:08:47 +00:00
Marc Gilleron 22471aafd0 Merge branch 'master' into instancing 2021-02-02 00:00:01 +00:00
Marc Gilleron 7682e8fbcc Comments 2021-01-30 01:39:28 +00:00
Marc Gilleron 3e510d2e93 `get_voxel` may be `const` 2020-12-30 20:09:31 +00:00
Marc Gilleron 791bdafff1 Meshers are now resources assigned on terrain nodes 2020-12-18 21:01:50 +00:00
Marc Gilleron d52f882ae1 VoxelMap is no longer bound, it had no use in the API 2020-11-21 18:31:11 +00:00
Marc Gilleron b16d8ff00d Update XML API docs, add a few more descriptions and fix some functions 2020-09-14 01:58:35 +01:00
Marc Gilleron d81ffb95f4 Detect usage of Tracy, add some profiler scopes 2020-08-30 04:00:01 +01:00
Marc Gilleron d4d2b6fd9e No longer copy voxels before scheduling threaded tasks. VoxelBuffers now have a lock. 2020-08-29 22:09:54 +01:00
Marc Gilleron c81f3d8f81 Skip whole blocks for random tick if they are made of a non-tickable type 2020-08-11 20:11:49 +01:00
Marc Gilleron 1a551fc77d Added support for per-voxel and per-block metadata 2020-08-10 19:03:01 +01:00
Marc Gilleron 1c6404efa5 Allow to use collision mask when raycasting blocky voxels 2020-08-06 19:58:36 +01:00
Marc Gilleron 47a6426a12 Fix 64-bit usage in VoxelTool 2020-08-06 19:54:47 +01:00
Marc Gilleron 0cdf5ea550 Added random tick API for blocky voxels 2020-07-28 20:32:33 +01:00
nic96 dede34acf1 Raycast shouldn't hit geometry type none 2020-07-05 19:15:08 -06:00
nic96 fe3c433f76 Transparent blocks should get hit by raycast if they have a collision aabb 2020-07-05 18:30:50 -06:00
Marc Gilleron 87a9766442 voxel_raycast is now template 2020-01-26 20:43:40 +00:00
Marc Gilleron 0ac1b7e6dc Moved edition-related classes to a sub-folder 2020-01-26 20:29:44 +00:00