Table of Contents

Class VoxelVolume

Namespace
VoxelPlayground.Engine
Assembly
VoxEngine.dll
[BurstCompile]
public class VoxelVolume : VoxelVolumeBase
Inheritance
object
VoxelVolume
Inherited Members
Extension Methods

Fields

checkConnectivity

public bool checkConnectivity

Field Value

bool

chunksTransform

[HideInInspector]
public Transform chunksTransform

Field Value

Transform

DebugVisualizeProperty

public PointDataV2.Property DebugVisualizeProperty

Field Value

PointDataV2.Property

emissionOutlinePassMaterial

public Material emissionOutlinePassMaterial

Field Value

Material

emissionPassMaterial

public Material emissionPassMaterial

Field Value

Material

fallbackVoxel

[NonSerialized]
[ShowInInspector]
[SuffixLabel("RuntimeOnly", false)]
public PointDataV2 fallbackVoxel

Field Value

PointDataV2

GlobalLodBias

public static float GlobalLodBias

Field Value

float

GodViewLodBias

public const float GodViewLodBias = 2

Field Value

float

HideMeshSideFlag

public HideSide HideMeshSideFlag

Field Value

HideSide

isFragment

public bool isFragment

Field Value

bool

isHideInitially

[NonSerialized]
public bool isHideInitially

Field Value

bool

isoLevel

public float isoLevel

Field Value

float

LastTimeCheckConnectivity

public float LastTimeCheckConnectivity

Field Value

float

layerID

public int layerID

Field Value

int

LodBias

public float LodBias

Field Value

float

lodGroup

public LODGroup lodGroup

Field Value

LODGroup

material

public Material material

Field Value

Material

MeshLodCount

public int MeshLodCount

Field Value

int

OnChunkMeshGenerationFinish

public Action<Mesh[], VoxelChunk> OnChunkMeshGenerationFinish

Field Value

Action<Mesh[], VoxelChunk>

OnChunkMeshGenerationStart

public Action<VoxelChunk> OnChunkMeshGenerationStart

Field Value

Action<VoxelChunk>

OnChunksAndDataReady

public Action OnChunksAndDataReady

Field Value

Action

OnFragmentsDetected

Params:

  1. Frags VoxelData, store in frag0 abc voxels, frag1 abc voxels etc.
  2. Bounds, length of 2*fragments, store in frag0BoundMin, frag0BoundMax, frag1BoundMin, frag1BoundMax etc.
  3. SolidCounts, length of fragments
  4. island ids, length of fragments + 1
  5. main island id of above island id

This event need to copy passed in data incase source is disposed

public Action<NativeList<PointDataV2>, NativeList<int3>, NativeList<int>, NativeSlice<int>, List<NativeSlice<int>>, NativeArray<bool>, bool, VoxelVolume> OnFragmentsDetected

Field Value

Action<NativeList<PointDataV2>, NativeList<int3>, NativeList<int>, NativeSlice<int>, List<NativeSlice<int>>, NativeArray<bool>, bool, VoxelVolume>

OnReadyForGameplay_Called_Once

public Action<VoxelVolume> OnReadyForGameplay_Called_Once

Field Value

Action<VoxelVolume>

OnVolumeDestroy

public Action<VoxelVolume> OnVolumeDestroy

Field Value

Action<VoxelVolume>

OnVoxelsModified

public Action<VoxelVolume> OnVoxelsModified

Field Value

Action<VoxelVolume>

renderQueue

public CustomRenderQueue renderQueue

Field Value

CustomRenderQueue

ticking

public bool ticking

Field Value

bool

timeSinceLastMeshUpdate

public float timeSinceLastMeshUpdate

Field Value

float

transparentPassMaterial

public Material transparentPassMaterial

Field Value

Material

UninitializedChunks

public HashSet<VoxelChunk> UninitializedChunks

Field Value

HashSet<VoxelChunk>

voxelChunks

[HideInInspector]
public VoxelChunk[] voxelChunks

Field Value

VoxelChunk[]

voxelDestructor

public IVoxelDestructible voxelDestructor

Field Value

IVoxelDestructible

Properties

AccurateLocalBounds

public Bounds AccurateLocalBounds { get; }

Property Value

Bounds

LoadDataVersion

public IVoxelVolumeSaveData.Version LoadDataVersion { get; }

Property Value

IVoxelVolumeSaveData.Version

solidBlockCountRatio

public float solidBlockCountRatio { get; }

Property Value

float

Methods

AddChildFragment(VoxelVolume)

public void AddChildFragment(VoxelVolume chunkBasedMarchingCube)

Parameters

chunkBasedMarchingCube VoxelVolume

CalculateBounds(int, int, int, PointDataV2*, float*)

[BurstCompile]
public static void CalculateBounds(int numPointsX, int numPointsY, int numPointsZ, PointDataV2* srcArray, float* min_max_array)

Parameters

numPointsX int
numPointsY int
numPointsZ int
srcArray PointDataV2*
min_max_array float*

CalculateBoundSphere()

public void CalculateBoundSphere()

ClearSmallFragment()

public IEnumerator ClearSmallFragment()

Returns

IEnumerator

CollectBatchLod()

public void CollectBatchLod()

CollectTick()

public void CollectTick()

ContainsPoint_CachedBounds_WorldSpace(Vector3)

public bool ContainsPoint_CachedBounds_WorldSpace(Vector3 point)

Parameters

point Vector3

Returns

bool

CreateEditorMesh(bool)

[Button]
public void CreateEditorMesh(bool loadFromFile = true)

Parameters

loadFromFile bool

DispatchBatchLod()

public JobHandle DispatchBatchLod()

Returns

JobHandle

ForceReloadData()

public UniTask ForceReloadData()

Returns

UniTask

ForceUpdateChunks()

public void ForceUpdateChunks()

GetBoundSphere(out Vector3, out float)

public void GetBoundSphere(out Vector3 center, out float radius)

Parameters

center Vector3
radius float

GetCurrentLodLevel()

Gets the current LOD (Level of Detail) level being rendered.

public int GetCurrentLodLevel()

Returns

int

-1 if LOD system is not initialized or no LOD is visible 0 for highest detail (individual chunks) 1 for medium detail (LOD1 combined mesh) 2 for lowest detail (LOD2 combined mesh)

GetMuscleVoxelCount(int)

public int GetMuscleVoxelCount(int boneIndex)

Parameters

boneIndex int

Returns

int

GuessChunkSizeAndPerAxis(int3, out int3, out int3, int)

public static void GuessChunkSizeAndPerAxis(int3 voxelSize, out int3 chunkCount, out int3 cubeCountsPerAxisInAChunk, int targetChunkSize = 20)

Parameters

voxelSize int3
chunkCount int3
cubeCountsPerAxisInAChunk int3
targetChunkSize int

Initialize()

public void Initialize()

IsGameplayReady()

public bool IsGameplayReady()

Returns

bool

IterateVoxelsSpherical(float3, float, IterateVoxelsInRadiusAction)

public void IterateVoxelsSpherical(float3 center_WS, float radius_WS, VoxelVolume.IterateVoxelsInRadiusAction visitor)

Parameters

center_WS float3
radius_WS float
visitor VoxelVolume.IterateVoxelsInRadiusAction

LoadDataAndInitializeFrom(VoxelVolume, Vector3Int, Vector3Int)

public Vector3 LoadDataAndInitializeFrom(VoxelVolume from, Vector3Int chunkMin, Vector3Int chunkMax)

Parameters

from VoxelVolume
chunkMin Vector3Int
chunkMax Vector3Int

Returns

Vector3

LoadDataAndInitilize(NativeArray<PointDataV2>)

public void LoadDataAndInitilize(NativeArray<PointDataV2> data)

Parameters

data NativeArray<PointDataV2>

LoadDataAndInitilize(NativeSlice<PointDataV2>, int3)

public void LoadDataAndInitilize(NativeSlice<PointDataV2> data, int3 sourceDim)

Parameters

data NativeSlice<PointDataV2>
sourceDim int3

LoadDataAndInitilize(IVoxelVolumeSaveData)

public void LoadDataAndInitilize(IVoxelVolumeSaveData cubeData)

Parameters

cubeData IVoxelVolumeSaveData

LoadEmptyData()

public void LoadEmptyData()

MarkChunksModified(Vector3Int, Vector3Int)

public void MarkChunksModified(Vector3Int chunkMin, Vector3Int chunkMax)

Parameters

chunkMin Vector3Int
chunkMax Vector3Int

MarkDirtyByLocalBounds(Bounds)

public void MarkDirtyByLocalBounds(Bounds localBouns)

Parameters

localBouns Bounds

OnDataModified(Vector3)

protected override void OnDataModified(Vector3 localPos)

Parameters

localPos Vector3

RefreshAll()

public void RefreshAll()

RegisterDependencyJobHandle(JobHandle)

Register a job handle that depends on this marching cube's data

public void RegisterDependencyJobHandle(JobHandle jobHandle)

Parameters

jobHandle JobHandle

Reset()

public override void Reset()

SetAllDirty()

public void SetAllDirty()

SetLayer(int)

public void SetLayer(int layer)

Parameters

layer int

SetMeshesVisible(bool)

public void SetMeshesVisible(bool visible)

Parameters

visible bool

SetRendererEnable(bool)

public void SetRendererEnable(bool value)

Parameters

value bool

UnregisterDependencyJobHandle(JobHandle)

public void UnregisterDependencyJobHandle(JobHandle jobHandle)

Parameters

jobHandle JobHandle

UpdateCachedBounds_WorldSpace()

public void UpdateCachedBounds_WorldSpace()

UpdateTick()

public void UpdateTick()

UpdateWorldToLocalMatrix()

public void UpdateWorldToLocalMatrix()