Instance Propertyheckj.voxels 0.2.6Voxels
memSize
MeshBuffer.swift:24var memSize: Int { get }
var memSize: Int { get }
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 Int
A signed integer value type.
init(positions: [SIMD3<Float>] = [], indices: [UInt32] = [], normals: [SIMD3<Float>] = [])
var indices: [UInt32]
The triangle mesh indices.
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