init(_:)
Creates a new index from a tuple of three integers.
init(_ tupleIn: (Int, Int, Int))
Parameters
- tupleIn
The tuple of three integers that represent the index.
Creates a new index from a tuple of three integers.
init(_ tupleIn: (Int, Int, Int))
The tuple of three integers that represent the index.
import Voxels
A Swift library for storage, manipulation, export, and 3D rendering of Voxel data.
struct VoxelIndex
The coordinates of a voxel location.
@frozen struct Int
A signed integer value type.
init()
init(_ arr: [Int])
Creates a new index from an array of integers.
init(_ x: Int, _ y: Int, _ z: Int)
Creates a new index
init(arrayLiteral scalars: Int...)
init(x: Int, y: Int, z: Int)
Creates a new index
static var one: VoxelIndex { get }
An index at the position (1, 1, 1)
static var zero: VoxelIndex { get }
An index at the position (0, 0, 0)
static func manhattan_distance(from: VoxelIndex, to: VoxelIndex) -> Int
static func neighbors<VOXEL>(distance: Int, origin: VoxelIndex, voxels: any VoxelAccessible<VOXEL>, strategy: NeighborStrategy = .raw) throws -> Set<VoxelIndex> where VOXEL : VoxelBlockRenderable
var description: String { get }
var id: String { get }
var x: Int { get }
The X coordinate.
var y: Int { get }
The Y coordinate.
var z: Int { get }
The Z coordinate.
static func < (lhs: VoxelIndex, rhs: VoxelIndex) -> Bool
func adding(_ i: `Self`) -> VoxelIndex
Returns a new voxel index that is the component sum of the current index and the index you provide.
func adding(_ x: Int, _ y: Int, _ z: Int) -> VoxelIndex
Returns a new voxel index offset from the current by the axis-aligned index values you provide.
func adding(x: Int = 0, y: Int = 0, z: Int = 0) -> VoxelIndex
Returns a new voxel index offset from the current by the axis-aligned index values you provide.
func manhattan_1_neighbors() -> [VoxelIndex]
Returns the manhattan neighbors with a distance of one from this index.
func manhattan_2_neighbors() -> [VoxelIndex]
Returns the manhattan neighbors with a distance of two from this index.
func subtracting(_ i: `Self`) -> VoxelIndex
Returns a new voxel index that is the component difference of the current index and the index you provide.
enum NeighborStrategy