Initializerheckj.voxels 0.2.6Voxels
init(positions:indices:normals:)
MeshBuffer.swift:95init(positions: [SIMD3<Float>] = [], indices: [UInt32] = [], normals: [SIMD3<Float>] = [])
init(positions: [SIMD3<Float>] = [], indices: [UInt32] = [], normals: [SIMD3<Float>] = [])
s6Voxels10MeshBufferV9positions7indices7normalsACSays5SIMD3VySfGG_Says6UInt32VGAJtcfc
What are these?44492
import Voxels
A Swift library for storage, manipulation, export, and 3D rendering of Voxel data.
struct MeshBuffer
A buffer of vertex indices, positions and normals that make up a generated 3D mesh.
@frozen struct SIMD3<Scalar> where Scalar : SIMDScalar
A vector of three scalar values.
@frozen struct Float
A single-precision, floating-point value type.
@frozen struct UInt32
A 32-bit unsigned integer value type.
var indices: [UInt32]
The triangle mesh indices.
var memSize: Int { get }
var normals: [SIMD3<Float>]
The triangle mesh normals.
var positions: [SIMD3<Float>]
The triangle mesh positions.
var quads: Int { get }
var triangles: Int { get }
mutating func addQuad(index: VoxelIndex, scale: VoxelScale<Float>, face: CubeFace)
Adds a quad, scaled for the exterior view of the face of the voxel you provide.
mutating func addQuadPoints(p1: SIMD3<Float>, p2: SIMD3<Float>, p3: SIMD3<Float>, p4: SIMD3<Float>)
Adds a quad, split along the shorter axis, into the mesh buffer.
mutating func reset()
Clears all of the buffers, but keeps the memory allocated for reuse.
func validate() throws
enum GeneratedMeshError