LavaUI docs GitHub

struct CatalogLayout3D

Swift

struct CatalogLayout3D

A reusable album/poster shelf that adds depth and fans neighboring items around a focused cover while keeping the unfocused catalog in one row.

Sources/LavaUI/Spatial.swift:316

Constructors

init(spacing: Float = 1.6, focusDepth: Float = 0.55, focusLift: Float = 0.08, focusScale: Float = 1.12, neighborSpread: Float = 0.28, neighborDepthStep: Float = 0.08, fanAngle: Angle3D = .degrees(10))

Creates a layout. Negative spacing and steps are clamped to zero.

Sources/LavaUI/Spatial.swift:333

Properties

var fanAngle: Angle3D

How much the neighbours turn toward the focused item.

Sources/LavaUI/Spatial.swift:330

var focusDepth: Float

How far the focused item comes forward, toward the camera.

Sources/LavaUI/Spatial.swift:320

var focusLift: Float

How far the focused item rises.

Sources/LavaUI/Spatial.swift:322

var focusScale: Float

Scale of the focused item.

Sources/LavaUI/Spatial.swift:324

var neighborDepthStep: Float

How far each further neighbour steps back, up to four steps.

Sources/LavaUI/Spatial.swift:328

var neighborSpread: Float

Extra distance neighbours move aside to make room for the focused item.

Sources/LavaUI/Spatial.swift:326

var spacing: Float

Distance between neighbouring items' centres, in world units.

Sources/LavaUI/Spatial.swift:318

Methods

static func focusedShelf(spacing: Float = 1.6, focusDepth: Float = 0.55, focusLift: Float = 0.08, focusScale: Float = 1.12, fanAngle: Angle3D = .degrees(10)) -> CatalogLayout3D

A shelf with the default spread and depth, tuned for album covers.

Sources/LavaUI/Spatial.swift:352

func pose(at index: Int, itemCount: Int, focusedIndex: Int?) -> CatalogPose3D

The pose of item index of itemCount, with focusedIndex focused, or no item focused when it is nil. The row is centred on x = 0.

Sources/LavaUI/Spatial.swift:367

func recommendedMinimumCameraDistance(itemCount: Int, itemWidth: Float, itemHeight: Float, clearance: Float = 2) -> Float

Conservative orbit radius that keeps the camera outside this shelf.

Sources/LavaUI/Spatial.swift:392