|
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 | SetMaterial (byte index, Material material) |
| Changes the material at a given index.
|
|
void | Clear () |
| Clears the voxel object.
|
|
bool | Raycast (Ray ray, out RaycastHit hit) |
| Finds an intersection of the ray and the voxel object.
|
|
void | SetupFromModel (Model model, ReadonlyArray< Material > palette) |
| Setting up the dynamic voxel object from the model prototype.
|
|
Vector3Int | TransformWorldToVoxel (Vector3 worldPosition) |
| Transforms world point to voxel coordinates.
|
|
int3 | TransformWorldToVoxel (float3 worldPosition) |
| Transforms world point to voxel coordinates.
|
|
Vector3 | TransformVoxelToWorld (Vector3Int voxelPosition) |
| Transforms voxel point to world position.
|
|
float3 | TransformVoxelToWorld (int3 voxelPosition) |
| Transforms voxel point to world position.
|
|
void | SetSphere (Vector3Int position, int radius, Voxel voxel) |
| Replaces the sphere of the voxels at a given position.
|
|
void | QueryVoxelsInSphere (Vector3Int position, int radius, List< VoxelQueryResult > target, VoxelQueryOptions queryOptions=VoxelQueryOptions.Default) |
| Fills the list of voxels in the volume.
|
|
|
virtual void | Update () |
|
virtual void | OnValidate () |
|
|
Bounds | LocalBounds [get] |
| The local bounds of the voxel object.
|
|
UnityEngine.Material | OpaqueMaterial [get, set] |
| The opaque material to be used for the meshes.
|
|
UnityEngine.Material | TransparentMaterial [get, set] |
| The transparent material to be used for the meshes.
|
|
IndexFormat | IndexFormat [get, set] |
| Gets/sets the index format used for the mesh.
|
|
int3 | Size [get, set] |
| Gets/sets the size of the voxel object which should be strictly larger than 0.
|
|
float | Scale [get, set] |
| The scale of the object.
|
|
int | ChunkSize [get, set] |
| Provides/sets the chunk size which should be strictly larger than 4.
|
|
Voxel | this[Vector3Int position] [get, set] |
| Sets/gets the voxel at/from a given position.
|
|
Voxel | this[int3 position] [get, set] |
| Sets/gets the voxel at/from a given position.
|
|
◆ IsInVolume() [1/2]
bool VoxelToolkit.DynamicVoxelObject.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.DynamicVoxelObject.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.
◆ QueryVoxelsInSphere()
void VoxelToolkit.DynamicVoxelObject.QueryVoxelsInSphere |
( |
Vector3Int |
position, |
|
|
int |
radius, |
|
|
List< VoxelQueryResult > |
target, |
|
|
VoxelQueryOptions |
queryOptions = VoxelQueryOptions::Default |
|
) |
| |
Fills the list of voxels in the volume.
- Parameters
-
position | The position of the sphere |
radius | The radius of the sphere |
target | Target list to fill |
queryOptions | Query filter options |
◆ Raycast()
bool VoxelToolkit.DynamicVoxelObject.Raycast |
( |
Ray |
ray, |
|
|
out RaycastHit |
hit |
|
) |
| |
Finds an intersection of the ray and the voxel object.
- Parameters
-
ray | The ray to be casted |
hit | The hit result of the raycast |
- Returns
- Returns true if raycast hit ended up hitting the voxel object
◆ SetMaterial()
void VoxelToolkit.DynamicVoxelObject.SetMaterial |
( |
byte |
index, |
|
|
Material |
material |
|
) |
| |
Changes the material at a given index.
- Parameters
-
index | The index the material has to be set |
material | The material to be set |
◆ SetSphere()
void VoxelToolkit.DynamicVoxelObject.SetSphere |
( |
Vector3Int |
position, |
|
|
int |
radius, |
|
|
Voxel |
voxel |
|
) |
| |
Replaces the sphere of the voxels at a given position.
- Parameters
-
position | The center position of the sphere |
radius | The radius of the sphere in voxels |
voxel | The voxel prototype to fill the sphere with |
◆ SetupFromModel()
Setting up the dynamic voxel object from the model prototype.
- Parameters
-
model | The model to setup from |
palette | The palette to use to setup the voxel object |
◆ TransformVoxelToWorld() [1/2]
float3 VoxelToolkit.DynamicVoxelObject.TransformVoxelToWorld |
( |
int3 |
voxelPosition | ) |
|
Transforms voxel point to world position.
- Parameters
-
voxelPosition | The position of the voxel to transform |
- Returns
- World coordinates
◆ TransformVoxelToWorld() [2/2]
Vector3 VoxelToolkit.DynamicVoxelObject.TransformVoxelToWorld |
( |
Vector3Int |
voxelPosition | ) |
|
Transforms voxel point to world position.
- Parameters
-
voxelPosition | The position of the voxel to transform |
- Returns
- World coordinates
◆ TransformWorldToVoxel() [1/2]
int3 VoxelToolkit.DynamicVoxelObject.TransformWorldToVoxel |
( |
float3 |
worldPosition | ) |
|
Transforms world point to voxel coordinates.
- Parameters
-
worldPosition | The world position to transform |
- Returns
- Voxel coordinate
◆ TransformWorldToVoxel() [2/2]
Vector3Int VoxelToolkit.DynamicVoxelObject.TransformWorldToVoxel |
( |
Vector3 |
worldPosition | ) |
|
Transforms world point to voxel coordinates.
- Parameters
-
worldPosition | The world position to transform |
- Returns
- Voxel coordinate
◆ ChunkSize
int VoxelToolkit.DynamicVoxelObject.ChunkSize |
|
getset |
Provides/sets the chunk size which should be strictly larger than 4.
- Exceptions
-
ArgumentException | Throws the exception if the chunk size is less than 4 |
◆ Size
int3 VoxelToolkit.DynamicVoxelObject.Size |
|
getset |
Gets/sets the size of the voxel object which should be strictly larger than 0.
- Exceptions
-
ArgumentException | Throws if one of the dimensions is smaller or equal to zero |
◆ this[int3 position]
Voxel VoxelToolkit.DynamicVoxelObject.this[int3 position] |
|
getset |
Sets/gets the voxel at/from a given position.
- Parameters
-
position | The position of the voxel to be gotten/set |
◆ this[Vector3Int position]
Voxel VoxelToolkit.DynamicVoxelObject.this[Vector3Int position] |
|
getset |
Sets/gets the voxel at/from a given position.
- Parameters
-
position | The position of the voxel to be gotten/set |
The documentation for this class was generated from the following file:
- Voxel Toolkit/Scripts/Runtime/DynamicVoxelObject.cs