VoxelFormat
Specifies the format of voxels.
Specifies the format of voxels.
Specifies the format of voxels. Currently, it only stores how many bytes each channel uses per voxel.
Voxels have a default format which is often enough for most use cases, but sometimes it is necessary to change it. In this case, you may create a new VoxelFormat resource, do the changes, and assign it to a VoxelEntity.
WARNING: it is recommended to choose a format early in development (whether it is the default, or a custom one). If you want to change much later and you have saves in the wild, you will have to figure out how to convert them, otherwise loading them will be problematic.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
VoxelFormatConstructor
public VoxelFormat();Properties5
ColorDepthProperty
public VoxelBuffer.Depth ColorDepth { get; set; }Depth of VoxelBuffer.ChannelId.ChannelColor.
IndicesDepthProperty
public VoxelBuffer.Depth IndicesDepth { get; set; }Depth of VoxelBuffer.ChannelId.ChannelIndices. Only 8-bit and 16-bit depths are supported.
SdfDepthProperty
public VoxelBuffer.Depth SdfDepth { get; set; }Depth of VoxelBuffer.ChannelId.ChannelSdf.
TypeDepthProperty
public VoxelBuffer.Depth TypeDepth { get; set; }Depth of VoxelBuffer.ChannelId.ChannelType. Only 8-bit and 16-bit depths are supported.
_DataProperty
public Reckfell.Collections.Array _Data { get; set; }Methods4
ConfigureBuffervoid
public void ConfigureBuffer(VoxelBuffer buffer);Clears and formats the VoxelBuffer using properties from the current format. Should be used on a buffer that hasn't been modified yet.
| Name | Type | Default |
|---|---|---|
buffer | VoxelBuffer | — |
CreateBufferVoxelBuffer
public VoxelBuffer CreateBuffer(Vector3I size);Creates a new VoxelBuffer that has the current format.
| Name | Type | Default |
|---|---|---|
size | Vector3I | — |
VoxelBufferGetChannelDepthVoxelBuffer.Depth
public VoxelBuffer.Depth GetChannelDepth(VoxelBuffer.ChannelId channelIndex);Gets the depth of a specific channel. See VoxelBuffer.Depth for more information.
| Name | Type | Default |
|---|---|---|
channelIndex | VoxelBuffer.ChannelId | — |
VoxelBuffer.DepthSetChannelDepthvoid
public void SetChannelDepth(VoxelBuffer.ChannelId channelIndex, VoxelBuffer.Depth depth);Sets the depth of a specific channel. See VoxelBuffer.Depth for more information.
| Name | Type | Default |
|---|---|---|
channelIndex | VoxelBuffer.ChannelId | — |
depth | VoxelBuffer.Depth | — |