The class responsible for a voxel meshes generation.
More...
|
| VoxelObject (Vector3Int size, ReadonlyArray< Material > palette, int chunkSize) |
| Creates the voxel object of the given size and chunks size.
|
|
| VoxelObject (Vector3Int size, int chunkSize) |
| Creates the voxel object of the given size and chunks size.
|
|
void | SetMaterial (byte index, Material material) |
| Sets the material for the voxel object.
|
|
MeshDescriptor | GetMesh (int index) |
| Get access to the generated mesh.
|
|
void | CopyTo (VoxelObject other) |
| Copies the voxel object from one to another.
|
|
bool | IsInVolume (Vector3Int value) |
| Checks if the voxel position belongs to the voxel object volume.
|
|
bool | IsInVolume (int3 value) |
| Checks if the voxel position belongs to the voxel object volume.
|
|
void | UpdateMeshes (IndexFormat indexFormat, Vector3 shift=new Vector3()) |
| Regenerates meshes.
|
|
void | DeleteMeshes () |
| Deletes all generated meshes.
|
|
void | Dispose () |
| Disposes the voxel object.
|
|
void | DisposeWithoutMeshes () |
| Disposes the voxel object but keeps meshes alive.
|
|
Model | ToModel () |
| Transforms voxel object to model.
|
|
|
int | MeshesCount [get] |
| The count of the generated meshes.
|
|
float | HueShift [get, set] |
| The hue shift to be applied to the materials.
|
|
float | Saturation [get, set] |
| Saturation to be applied to the materials.
|
|
float | Brightness [get, set] |
| Brightness to be applied to the materials.
|
|
MeshGenerationApproach | MeshGenerationApproach [get, set] |
|
float | Scale [get, set] |
| The scale of the voxel object.
|
|
float | OpaqueEdgeShift [get, set] |
| The shift of the edge of the voxel object applied for opaque objects.
|
|
float | TransparentEdgeShift [get, set] |
| The shift of the edge of the voxel object applied for transparent objects.
|
|
int3 | Size [get] |
| Provides the size of the voxel object.
|
|
Vector3Int | ChunksCount [get] |
| The count of the chunks for the current voxel object.
|
|
Voxel | this[Vector3Int position] [get, set] |
| Provides access to a specific voxel of the voxel object.
|
|
Voxel | this[int3 position] [get, set] |
| Provides access to a specific voxel of the voxel object.
|
|
The class responsible for a voxel meshes generation.
◆ VoxelObject() [1/2]
VoxelToolkit.VoxelObject.VoxelObject |
( |
Vector3Int |
size, |
|
|
ReadonlyArray< Material > |
palette, |
|
|
int |
chunkSize |
|
) |
| |
Creates the voxel object of the given size and chunks size.
- Parameters
-
size | The size of the voxel object |
palette | The palette to be used for the mesh generation |
chunkSize | The chunk size of the voxel object |
◆ VoxelObject() [2/2]
VoxelToolkit.VoxelObject.VoxelObject |
( |
Vector3Int |
size, |
|
|
int |
chunkSize |
|
) |
| |
Creates the voxel object of the given size and chunks size.
- Parameters
-
size | The size of the voxel object |
chunkSize | The chunk size of the voxel object |
◆ CopyTo()
void VoxelToolkit.VoxelObject.CopyTo |
( |
VoxelObject |
other | ) |
|
Copies the voxel object from one to another.
- Parameters
-
other | The object to copy to |
◆ CreateFromModel()
Creates voxel object directly from voxel model.
- Parameters
-
model | The voxel model voxel object to be created from |
palette | The palette used for mesh generation |
chunkSize | The chunk size of the object to be generated |
- Returns
◆ GetMesh()
Get access to the generated mesh.
- Parameters
-
index | The index of the mesh to obtain |
- Returns
- Mesh descriptor of the requested mesh
◆ IsInVolume() [1/2]
bool VoxelToolkit.VoxelObject.IsInVolume |
( |
int3 |
value | ) |
|
Checks if the voxel position belongs to the voxel object volume.
- Parameters
-
value | The position to check |
- Returns
- True if the position is inside the voxel object volume. False if not.
◆ IsInVolume() [2/2]
bool VoxelToolkit.VoxelObject.IsInVolume |
( |
Vector3Int |
value | ) |
|
Checks if the voxel position belongs to the voxel object volume.
- Parameters
-
value | The position to check |
- Returns
- True if the position is inside the voxel object volume. False if not.
◆ SetMaterial()
void VoxelToolkit.VoxelObject.SetMaterial |
( |
byte |
index, |
|
|
Material |
material |
|
) |
| |
Sets the material for the voxel object.
- Parameters
-
index | The index of the material to be set |
material | The material to be set |
◆ ToModel()
Model VoxelToolkit.VoxelObject.ToModel |
( |
| ) |
|
Transforms voxel object to model.
- Returns
- Model representing the voxel object
◆ UpdateMeshes()
void VoxelToolkit.VoxelObject.UpdateMeshes |
( |
IndexFormat |
indexFormat, |
|
|
Vector3 |
shift = new Vector3() |
|
) |
| |
Regenerates meshes.
- Parameters
-
indexFormat | The index format to be used for the meshes |
generationApproach | The generation approach to be taken to generate meshes |
shift | The shift applied to the vertices |
◆ this[int3 position]
Voxel VoxelToolkit.VoxelObject.this[int3 position] |
|
getset |
Provides access to a specific voxel of the voxel object.
- Parameters
-
position | The position of the voxel |
◆ this[Vector3Int position]
Voxel VoxelToolkit.VoxelObject.this[Vector3Int position] |
|
getset |
Provides access to a specific voxel of the voxel object.
- Parameters
-
position | The position of the voxel |
The documentation for this class was generated from the following file:
- Voxel Toolkit/Scripts/Runtime/VoxelObject.cs