public T this[NeighborDirection nd] { get { return(this[center + CubeNeighbors6.Relative(nd)]); } set { this[center + CubeNeighbors6.Relative(nd)] = value; } }
public T this[int i] { get { return(this[center + CubeNeighbors6.Relative(i)]); } set { this[center + CubeNeighbors6.Relative(i)] = value; } }
public void Execute(int index) { var pos = IntVector3.FromUint256(displayVoxels[index].voxel); bool hidden = false; int div = (int)Mathf.Pow(2, lodIndex); var touchDirections = CubeNeighbors6.TouchFaces(pos / div, chunkSize / div).ToList(); foreach (var nd in touchDirections) { hidden = true; var oppDir = CubeNeighbors6.Opposite(nd); var opp = CubeNeighbors6.SnapToFace(pos / div, chunkSize / div, oppDir); uint voxel = GetVoxelFromGenDataArray(get(nd), opp); if (voxel == EmptyVoxel) { hidden = false; break; } } if (hidden) { foreach (var nd in CubeNeighbors6.Directions) { if (touchDirections.Contains(nd)) { continue; } var nudge = pos / div + CubeNeighbors6.Relative(nd); uint voxel = GetVoxelFromGenDataArray(center, nudge); if (voxel == EmptyVoxel) { hidden = false; break; } } } if (hidden) { var geomData = displayVoxels[index]; geomData.voxel = EmptyVoxel; displayVoxels[index] = geomData; } }
public bool Contains(NeighborDirection nd) { return(storage.ContainsKey(center + CubeNeighbors6.Relative(nd))); }