piratux / caveeditor Goto Github PK
View Code? Open in Web Editor NEWCave editor using Godot and godot_voxel module.
License: MIT License
Cave editor using Godot and godot_voxel module.
License: MIT License
_unhandled_input()
in HelpWindow.gd
doesn't fire when mouse is captured (mouse is hidden) from capture_mouse
in SmoothWorld.gd
:
capture_mouse(value):
#...
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
ui_root.process_mode = Node.PROCESS_MODE_DISABLED
set_ui_element_mouse_filter(ui_root, false)
This makes H to toggle help window not work when mouse is captured.
As title says, consider adding do_flatten
function to VoxelTool. This is basically do_hemisphere
, with addition of gradual appearance overtime (similar to that of Unreal Engine voxel plugin flatten tool):
// Apply falloff for gradual effect
float weight = std::max(0.0f, (sphere_radius - dist) / sphere_radius);
do_flatten
source code example (outdated, but gets the idea across):
void do_flatten(const VoxelBufferInternal &src, VoxelBufferInternal &dst, Vector3 flat_direction, float smoothness, Vector3f sphere_pos,
float sphere_radius, float sdf_scale, bool mode_add) {
ZN_PROFILE_SCOPE();
const Vector3i dst_size = src.get_size();
ZN_ASSERT_RETURN(sphere_radius > 0);
ZN_ASSERT_RETURN(dst_size.x > 0);
ZN_ASSERT_RETURN(dst_size.y > 0);
ZN_ASSERT_RETURN(dst_size.z > 0);
dst.create(dst_size);
const Vector3 sphere_pos_vec3 = Vector3(sphere_pos.x, sphere_pos.y, sphere_pos.z);
Vector3 dst_pos;
Vector3 center = Vector3(0, 0, 0);
// TODO: avoid offsetting plane to go through center?
real_t plane_d = 0;
for (dst_pos.z = 0; dst_pos.z < dst_size.z; ++dst_pos.z) {
for (dst_pos.x = 0; dst_pos.x < dst_size.x; ++dst_pos.x) {
for (dst_pos.y = 0; dst_pos.y < dst_size.y; ++dst_pos.y) {
const float src_sd = src.get_voxel_f(dst_pos, VoxelBufferInternal::CHANNEL_SDF);
Vector3 pos = dst_pos - sphere_pos_vec3;
float sd_new = sdf_scale *
math::sdf_smooth_subtract( //
math::sdf_sphere(pos, center, sphere_radius), //
math::sdf_plane(pos, flat_direction, plane_d), smoothness);
float sd = 0.0f;
if (mode_add){
sd = math::sdf_union(src_sd, sd_new);
}
else{
sd = math::sdf_subtract(src_sd, sd_new);
}
float dist = pos.length();
// Apply falloff for gradual effect
float weight = std::max(0.0f, (sphere_radius - dist) / sphere_radius);
// TODO: consider adding parameter that controls falloff
weight = math::clamp(weight * 2.0, 0.1, 1.0);
sd = Math::lerp(src_sd, sd, weight);
dst.set_voxel_f(sd, dst_pos, VoxelBufferInternal::CHANNEL_SDF);
}
}
}
}
Here is a list of things that should be implemented, to improve code quality:
Surface tool performs edits far slower than intended with newest godot_voxel version.
Investigate why is that.
Potential clues:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.