VoxelEngine¶
Inherits: Object
Singleton holding common settings and handling voxel processing tasks in background threads.
Methods:¶
| Return | Signature |
|---|---|
| Dictionary | get_stats ( ) const |
| int | get_thread_count ( ) const |
| bool | get_threaded_graphics_resource_building_enabled ( ) const |
| String | get_version_edition ( ) const |
| String | get_version_git_hash ( ) const |
| int | get_version_major ( ) const |
| int | get_version_minor ( ) const |
| int | get_version_patch ( ) const |
| String | get_version_status ( ) const |
| Vector3i | get_version_v ( ) const |
| void | run_tests ( Dictionary options ) |
| void | set_thread_count ( int count ) |
Method Descriptions¶
Dictionary get_stats( )¶
Gets debug information about shared voxel processing.
The returned dictionary has the following structure:
{
"thread_pools": {
"general": {
"tasks": int,
"active_threads": int,
"thread_count": int,
"task_names": PackedStringArray
}
},
"tasks": {
"streaming": int,
"meshing": int,
"generation": int,
"main_thread": int,
"gpu": int
},
"memory_pools": {
"voxel_used": int,
"voxel_total": int,
"block_count": int,
"std_allocated": int,
"std_deallocated": int,
"std_current": int
}
}
int get_thread_count( )¶
Returns the number of threads currently used internally by the ThreadedTaskRunner.
bool get_threaded_graphics_resource_building_enabled( )¶
Tells if the voxel engine is able to create graphics resources from different threads. This will usually be true if the current renderer's thread model is safe or multi-threaded, but might also be false if the renderer would poorly benefit from this (such as legacy OpenGL).
String get_version_edition( )¶
Tells the edition of the voxel engine, which is either of the following: module, extension
String get_version_git_hash( )¶
Gets the Git hash that was used to compile the voxel engine.
int get_version_major( )¶
Gets the major version number of the voxel engine. For example, in 1.2.0, 1 is the major version.
int get_version_minor( )¶
Gets the minor version number of the voxel engine. For example, in 1.2.0, 2 is the minor version.
int get_version_patch( )¶
Gets the patch version number of the voxel engine. For example, in 1.2.0, 0 is the patch version.
String get_version_status( )¶
Gets the version status, which may be one of the following: dev, release
Vector3i get_version_v( )¶
Gets the major (x), minor (y) and patch (z) version numbers of the voxel engine as a single vector. May be useful for comparisons.
void run_tests( Dictionary options )¶
Runs internal unit tests. This function is only available if the voxel engine is compiled with voxel_tests=true.
void set_thread_count( int count )¶
Sets the number of threads to be used internally by the ThreadedTaskRunner. Setting this can cause lagging, and it might take some time until the number of threads actually matches the given value.
Generated on Jan 26, 2026