Helper class to easily access and modify voxels
Abstract interface to access and edit voxels. It allows accessing individual voxels, or doing bulk operations such as carving large chunks or copy/paste boxes.
It's not a class to instantiate alone, you may get it from the voxel objects you want to work with.
Operate on a rectangular cuboid section of the terrain. [code]begin[/code] and [code]end[/code] are inclusive. Choose operation and which voxel to use by setting [code]value[/code] and [code]mode[/code] before calling this function.
Set which channel will be edited. When used on a terrain node, it will default to the first available channel, based on the stream and generator.
Sets which value will be used to erase voxels when editing the [enum VoxelBuffer.CHANNEL_TYPE] channel in [enum MODE_REMOVE] mode.
Sets how [code]do_*[/code] functions will behave. This may vary depending on the channel.
When working with smooth voxels, applies a scale to the signed distance field. A high scale (1 or higher) will tend to produce blocky results, and a low scale (below 1, but not too close to zero) will tend to be smoother.
This is related to the [enum VoxelBuffer.Depth] configuration on voxels. For 8-bit and 16-bit, there is a limited range of values the Signed Distance Field can take, and by default it is clamped to -1..1, so the gradient can only range across 2 voxels. But when LOD is used, it is better to stretch that range over a longer distance, and this is achieved by scaling SDF values.
Sets which voxel value will be used. This is not relevant when editing [enum VoxelBuffer.CHANNEL_SDF].
When editing [enum VoxelBuffer.CHANNEL_SDF], will add matter. Useful for building.
When editing [enum VoxelBuffer.CHANNEL_SDF], will subtract matter. Useful for digging.
Replace voxel values without any blending. Useful for blocky voxels.