Inherits: Resource

Model stored in VoxelBlockyLibrary and used by VoxelMesherBlocky.


Represents a model to be used for voxels of a specific TYPE value. Such models must be contained within a VoxelBlockyLibrary to be used with VoxelTerrain or directly with a VoxelMesherBlocky.

A model can be setup in various ways, see child classes.


Type Name Default
AABB[] collision_aabbs []
int collision_mask 1
Color color Color(1, 1, 1, 1)
bool random_tickable false
int transparency_index 0
bool culls_neighbors true
bool transparent false


Return Signature
Material get_material_override ( int index ) const
bool is_mesh_collision_enabled ( int surface_index ) const
void rotate_90 ( int _unnamed_arg0, bool _unnamed_arg1 )
void set_material_override ( int index, Material material )
void set_mesh_collision_enabled ( int surface_index, bool enabled )


enum Side:

  • SIDE_COUNT = 6

Property Descriptions

List of bounding boxes relative to the model. They are used for box-based collision, using VoxelBoxMover. They are not used with mesh-based collision.

  • int collision_mask = 1

Collision mask used for box-based collision VoxelBoxMover and voxel raycasts (VoxelToolTerrain). It is not used for mesh-based collisions.

  • Color color = Color(1, 1, 1, 1)

Color of the model. It will be used to modulate its color when built into a voxel mesh.

  • bool random_tickable = false

If enabled, voxels having this ID in the TYPE channel will be used by VoxelToolTerrain.run_blocky_random_tick.

  • int transparency_index = 0

Determines how transparency is handled when the sides of the model are culled by neighbor voxels.

Equal indices culls the face, different indexes doesn't.

  • bool culls_neighbors = true

If enabled, this voxel culls the faces of its neighbors. Disabling can be useful for denser transparent voxels, such as foliage.

  • bool transparent = false

Tells if the model is transparent in the context of sides being culled by neighbor voxels.

This is a legacy property, VoxelBlockyModel.transparency_index may be used instead.

Method Descriptions

Gets the material override for a specific surface of the model.

  • bool is_mesh_collision_enabled( int surface_index )

Tells if a specific surface produces mesh-based collisions.

Sets a material override for a specific surface of the model. It allows to use the same mesh on multiple models, but using different materials on each.

  • void set_mesh_collision_enabled( int surface_index, bool enabled )

Enables or disables mesh-based collision on a specific surface. It allows a model to have solid parts and others where players can pass through.

Generated on Sep 12, 2023