VoxelBlockyModel¶
Inherits: Resource
Inherited by: VoxelBlockyModelCube, VoxelBlockyModelEmpty, VoxelBlockyModelFluid, VoxelBlockyModelMesh
Model stored in VoxelBlockyLibrary and used by VoxelMesherBlocky.
Description:¶
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.
Properties:¶
| Type | Name | Default |
|---|---|---|
| AABB[] | collision_aabbs | [] |
| int | collision_mask | 1 |
| Color | color | Color(1, 1, 1, 1) |
| bool | culls_neighbors | true |
| bool | lod_skirts_enabled | true |
| bool | random_tickable | false |
| int | tags_mask | 1 |
| int | transparency_index | 0 |
Methods:¶
| Return | Signature |
|---|---|
| Material | get_material_override ( int index ) const |
| int | get_mesh_ortho_rotation_index ( ) const |
| bool | is_mesh_collision_enabled ( int surface_index ) const |
| void | rotate_90 ( Axis axis, bool clockwise ) |
| void | set_material_override ( int index, Material material ) |
| void | set_mesh_collision_enabled ( int surface_index, bool enabled ) |
| void | set_mesh_ortho_rotation_index ( int i ) |
Enumerations:¶
enum Side:
- SIDE_NEGATIVE_X = 1
- SIDE_POSITIVE_X = 0
- SIDE_NEGATIVE_Y = 2
- SIDE_POSITIVE_Y = 3
- SIDE_NEGATIVE_Z = 4
- SIDE_POSITIVE_Z = 5
- SIDE_COUNT = 6
Property Descriptions¶
AABB[] collision_aabbs = []¶
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 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 lod_skirts_enabled = true¶
If enabled and the terrain has LODs, this model will produce skirts when located at the edge of a chunk. This is intented to hide "cracks" between chunks of different LOD.
You may turn this off if the model is transparent, as the skirt would become visible from behind other surfaces.
bool random_tickable = false¶
If enabled, voxels having this ID in the TYPE channel will be used by VoxelToolTerrain.run_blocky_random_tick.
int tags_mask = 1¶
Bitmask used to filter this model in some operations. For example, see 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.
If the neighbor voxel at a given side has a transparency index lower or equal to the current voxel, the side will be culled.
Method Descriptions¶
Material get_material_override( int index )¶
Gets the material override for a specific surface of the model.
int get_mesh_ortho_rotation_index( )¶
Gets the 90-degree rotation ID that will be applied to the model when the library is baked.
bool is_mesh_collision_enabled( int surface_index )¶
Tells if a specific surface produces mesh-based collisions.
void rotate_90( Axis axis, bool clockwise )¶
(This method has no documentation)
void set_material_override( int index, Material material )¶
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.
void set_mesh_ortho_rotation_index( int i )¶
Gets the 90-degree rotation ID that will be applied to the model when the library is baked. This is a number representing one of 24 possible 90-degree rotations. You can also use rotate_90.
Generated on Jan 26, 2026