Zylann / godot_voxel

Voxel module for Godot Engine
MIT License
2.59k stars 244 forks source link

VoxelGenerator Generated API Binding has Unusable Const out_buffer #357

Open MadMartian opened 2 years ago

MadMartian commented 2 years ago

For some reason, the API bindings generator that generates these HPP files is generating VoxelGenerator::generate_block with an unusable out_buffer parameter:

void generate_block(const Ref<VoxelBuffer> out_buffer, const Vector3 origin_in_voxels, const int64_t lod);

As you can see, out_buffer is const and cannot be modified by the implementing code. This leads me to believe that implementing a custom VoxelGenerator in C++ isn't possible, or that there is some other way to do it that I am unaware of? Will I have to fork this repository to achieve this? Ideally it would be good to avoid forks in order to get regular updates.

Zylann commented 2 years ago

That looks like a bug in whichever binding generator you are using. This argument is definitely not const. I didn't know making all arguments const was even a thing Oo That looks recent. Either way, this is an issue of the bindings generator, not the module.

Workaround:

Ref<VoxelBuffer> modifiable_buffer = out_buffer;