Skip to content

VoxelSet

Christian Cuevas edited this page Jan 12, 2021 · 4 revisions

About

VoxelSets are Resources that contain a library of voxels used by VoxelObjects, they work much like TileSets do for TileMaps. They can be created, shared and saved like any other Godot Resource. Aside from containing voxels they also have a Tiles texture used for UV Mapping, and an array of SpatialMaterials / Shaders which can be assigned to groups of voxels via their properties, reference voxel schema.

Note: VoxelSet is declared with class_name VoxelSet, which means that while Voxel-Core is active, you can access VoxelSet from anywhere without having to load it.

Usage

var vs := VoxelSet.new()
vs.add_voxel(Voxel.colored(Color.blue))

var vm := VoxelMesh.new()
vm.voxel_set = vs
vm.set_voxel(Vector3(0, 0, 0), 0)
vm.update_mesh()
Clone this wiki locally