Zylann / godot_voxel

Voxel module for Godot Engine
MIT License
2.72k stars 251 forks source link

Collapse of towering voxels #646

Open JekSun97 opened 5 months ago

JekSun97 commented 5 months ago

I apologize for not filling out the description, I haven’t really used your plugin yet. But before using it, I would like to clarify the question, I want to use smooth voxels for my game (not cubic ones), and is it possible to somehow determine that a voxel weighs in the air and does not touch other voxels, for example, if we sculpt walls with a ceiling , and then remove the walls, the ceiling voxels could somehow be removed and cause earth particles in this place, is it possible to do this with your plugin?

Zylann commented 5 months ago

In VoxelLodTerrain, There is a function to separate floating chunks within a specified area, which will be removed from the terrain and turned into rigidbodies, which then fall over. Though I'm not sure if it will be enough if you want to base your entire game on this mechanic, it has to process every voxel at once in the area and it's more expensive the bigger the area is. It's mostly something I implemented in several days and haven't touched since. If you need tweaks or something different, you might want to do your own: https://github.com/Zylann/godot_voxel/blob/93419cb6d10e7a5ac28ecbc16e8101da698bd37b/edition/voxel_tool_lod_terrain.cpp#L501