reckfellENGINE

VoxelStream

Implements loading and saving voxel blocks, mainly using files.

On this page
class VoxelStreamReckfellSharpInherits Resource

Implements loading and saving voxel blocks, mainly using files.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Properties2

CompressionModeProperty
# CompressionMode
C#
public VoxelBlockSerializer.Compression CompressionMode { get; set; }

Specifies which compression algorithm is used when saving blocks. This can reduce the size of save files at the cost of save/load performance. Existing blocks that formerly used a different compression mode can still be loaded, and will use the new mode if saved again.

SaveGeneratorOutputProperty
# SaveGeneratorOutput
C#
public bool SaveGeneratorOutput { get; set; }

When this is enabled, if a block cannot be found in the stream and it gets generated, then the generated block will immediately be saved into the stream. This can be used if the generator is too expensive to run on the fly (like Minecraft does), but it will require more disk usage (amount of I/Os and space) and increase network traffic. If this setting is off, only modified blocks will be saved.

Methods9

Flushvoid
# Flush
C#
public void Flush();

Forces cached data to be saved to the filesystem. Some streams might use a cache to improve performance of frequent I/Os. This should not be called frequently if performance is a concern. May be used if you require all data to be written now. Note that implementations should already do this automatically when the resource is destroyed or their configuration changes. Some implementations may do nothing if they have no cache. Note that terrains save asynchronously, so flushing might not always fulfill your goal if saving tasks are still queued and haven't called into VoxelStream yet. See VoxelTerrain.SaveModifiedBlocks or VoxelLodTerrain.SaveModifiedBlocks.

GetBlockSizeVector3
# GetBlockSize
C#
public Vector3 GetBlockSize();
Returns Vector3
GetCompressionModeVoxelBlockSerializer.Compression
# GetCompressionMode
C#
public VoxelBlockSerializer.Compression GetCompressionMode();
Returns VoxelBlockSerializer.Compression
GetSaveGeneratorOutputbool
# GetSaveGeneratorOutput
C#
public bool GetSaveGeneratorOutput();
Returns bool
GetUsedChannelsMaskint
# GetUsedChannelsMask
C#
public int GetUsedChannelsMask();
Returns int
LoadVoxelBlockVoxelStream.ResultCode
# LoadVoxelBlock
C#
public VoxelStream.ResultCode LoadVoxelBlock(VoxelBuffer outBuffer, Vector3I blockPosition, int lodIndex);

out_buffer: Block of voxels to load. Must be a pre-created instance (not null). block_position: Position of the block in block coordinates within the specified LOD.

Parameters
NameTypeDefault
outBufferVoxelBuffer—
blockPositionVector3I—
lodIndexint—
Returns VoxelStream.ResultCode
SaveVoxelBlockvoid
# SaveVoxelBlock
C#
public void SaveVoxelBlock(VoxelBuffer buffer, Vector3I blockPosition, int lodIndex);

buffer: Block of voxels to save. It is strongly recommended to not keep a reference to that data afterward, because streams are allowed to cache it, and saved data must represent either snapshots (copies) or last references to the data after the volume they belonged to is destroyed. block_position: Position of the block in block coordinates within the specified LOD.

Parameters
NameTypeDefault
bufferVoxelBuffer—
blockPositionVector3I—
lodIndexint—
SetCompressionModevoid
# SetCompressionMode
C#
public void SetCompressionMode(VoxelBlockSerializer.Compression mode);
Parameters
NameTypeDefault
modeVoxelBlockSerializer.Compression—
SetSaveGeneratorOutputvoid
# SetSaveGeneratorOutput
C#
public void SetSaveGeneratorOutput(bool enabled);
Parameters
NameTypeDefault
enabledbool—

VoxelStream.ResultCode

ValueDescription
BlockFound = 2

The block was found.

BlockNotFound = 1

The block was not found. The requester may fallback on using the generator, if any.

Error = 0

An error occurred when loading the block. The request will be aborted.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.