VoxelIndex
The coordinates of a voxel location.
struct VoxelIndex
The coordinates of a voxel location.
struct VoxelIndex
import Voxels
A Swift library for storage, manipulation, export, and 3D rendering of Voxel data.
struct VoxelBounds
The coordinate bounds of a set of voxels.
protocol StrideIndexable
A type that can be accessed with a single, linear location within an array.
struct VoxelScale<T> where T : SIMDScalar, T : Sendable
A scale that provides a mapping between Voxel coordinates and 3D points.
struct MeshBuffer
A buffer of vertex indices, positions and normals that make up a generated 3D mesh.
typealias Vector = SIMD3<Float>
A compact representation of a 3 dimensional vector.
let CUBE_CORNERS: [VoxelIndex]
The collection of voxel index offsets for the corners of a voxel.
enum CubeFace
The set of cube faces and relevant directions and coordinates of those faces.
protocol Comparable : Equatable
A type that can be compared using the relational operators <
, <=
, >=
, and >
.
protocol Copyable
A type whose values can be implicitly or explicitly copied.
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Escapable
protocol ExpressibleByArrayLiteral
A type that can be initialized using an array literal.
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol Sendable
init()
init(_ arr: [Int])
Creates a new index from an array of integers.
init(_ tupleIn: (Int, Int, Int))
Creates a new index from a tuple of three 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
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.
static func ... (minimum: Self) -> PartialRangeFrom<Self>
Returns a partial range extending upward from a lower bound.
static func ... (maximum: Self) -> PartialRangeThrough<Self>
Returns a partial range up to, and including, its upper bound.
static func ... (minimum: Self, maximum: Self) -> ClosedRange<Self>
Returns a closed range that contains both of its bounds.
static func ..< (maximum: Self) -> PartialRangeUpTo<Self>
Returns a partial range up to, but not including, its upper bound.
static func ..< (minimum: Self, maximum: Self) -> Range<Self>
Returns a half-open range that contains its lower bound but not its upper bound.
static func <= (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether the value of the first argument is less than or equal to that of the second argument.
static func > (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether the value of the first argument is greater than that of the second argument.
static func >= (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether the value of the first argument is greater than or equal to that of the second argument.