VoxelBlockyModel
Model stored in VoxelBlockyLibrary and used by VoxelMesherBlocky.
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.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
VoxelBlockyModelConstructor
public VoxelBlockyModel();Properties8
CollisionAabbsProperty
public Reckfell.Collections.Array<Aabb> CollisionAabbs { get; set; }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.
CollisionMaskProperty
public uint CollisionMask { get; set; }Collision mask used for box-based collision VoxelBoxMover and voxel raycasts (VoxelToolTerrain). It is not used for mesh-based collisions.
ColorProperty
public Color Color { get; set; }Color of the model. It will be used to modulate its color when built into a voxel mesh.
CullsNeighborsProperty
public bool CullsNeighbors { get; set; }If enabled, this voxel culls the faces of its neighbors. Disabling can be useful for denser transparent voxels, such as foliage.
LodSkirtsEnabledProperty
public bool LodSkirtsEnabled { get; set; }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.
RandomTickableProperty
public bool RandomTickable { get; set; }If enabled, voxels having this ID in the TYPE channel will be used by VoxelToolTerrain.RunBlockyRandomTick.
TagsMaskProperty
public uint TagsMask { get; set; }Bitmask used to filter this model in some operations. For example, see VoxelToolTerrain.RunBlockyRandomTick.
TransparencyIndexProperty
public int TransparencyIndex { get; set; }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.
Methods23
GetCollisionAabbsReckfell.Collections.Array<Aabb>
public Reckfell.Collections.Array<Aabb> GetCollisionAabbs();Reckfell.Collections.Array<Aabb>GetCollisionMaskuint
public uint GetCollisionMask();uintGetColorColor
public Color GetColor();ColorGetCullsNeighborsbool
public bool GetCullsNeighbors();boolGetLodSkirtsEnabledbool
public bool GetLodSkirtsEnabled();boolGetMaterialOverrideMaterial
public Material GetMaterialOverride(int index);Gets the material override for a specific surface of the model.
| Name | Type | Default |
|---|---|---|
index | int | — |
MaterialGetMeshOrthoRotationIndexint
public int GetMeshOrthoRotationIndex();Gets the 90-degree rotation ID that will be applied to the model when the library is baked.
intGetTagsMaskuint
public uint GetTagsMask();uintGetTransparencyIndexint
public int GetTransparencyIndex();intIsMeshCollisionEnabledbool
public bool IsMeshCollisionEnabled(int surfaceIndex);Tells if a specific surface produces mesh-based collisions.
| Name | Type | Default |
|---|---|---|
surfaceIndex | int | — |
boolIsRandomTickablebool
public bool IsRandomTickable();boolRotate90void
public void Rotate90(Vector3I.Axis axis, bool clockwise);| Name | Type | Default |
|---|---|---|
axis | Vector3I.Axis | — |
clockwise | bool | — |
SetCollisionAabbsvoid
public void SetCollisionAabbs(Reckfell.Collections.Array<Aabb> aabbs);| Name | Type | Default |
|---|---|---|
aabbs | Reckfell.Collections.Array<Aabb> | — |
SetCollisionMaskvoid
public void SetCollisionMask(uint mask);| Name | Type | Default |
|---|---|---|
mask | uint | — |
SetColorvoid
public void SetColor(Color color);| Name | Type | Default |
|---|---|---|
color | Color | — |
SetCullsNeighborsvoid
public void SetCullsNeighbors(bool cullsNeighbors);| Name | Type | Default |
|---|---|---|
cullsNeighbors | bool | — |
SetLodSkirtsEnabledvoid
public void SetLodSkirtsEnabled(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetMaterialOverridevoid
public void SetMaterialOverride(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.
| Name | Type | Default |
|---|---|---|
index | int | — |
material | Material | — |
SetMeshCollisionEnabledvoid
public void SetMeshCollisionEnabled(int surfaceIndex, 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.
| Name | Type | Default |
|---|---|---|
surfaceIndex | int | — |
enabled | bool | — |
SetMeshOrthoRotationIndexvoid
public void SetMeshOrthoRotationIndex(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 VoxelBlockyModel.Rotate90.
| Name | Type | Default |
|---|---|---|
i | int | — |
SetRandomTickablevoid
public void SetRandomTickable(bool _UnnamedArg0);| Name | Type | Default |
|---|---|---|
_UnnamedArg0 | bool | — |
SetTagsMaskvoid
public void SetTagsMask(uint _UnnamedArg0);| Name | Type | Default |
|---|---|---|
_UnnamedArg0 | uint | — |
SetTransparencyIndexvoid
public void SetTransparencyIndex(int transparencyIndex);| Name | Type | Default |
|---|---|---|
transparencyIndex | int | — |