diff --git a/avlivebody-mac/Sources/AVLiveBody/RenderSettings.swift b/avlivebody-mac/Sources/AVLiveBody/RenderSettings.swift new file mode 100644 index 0000000..3cc821e --- /dev/null +++ b/avlivebody-mac/Sources/AVLiveBody/RenderSettings.swift @@ -0,0 +1,31 @@ +// avlivebody-mac/Sources/AVLiveBody/RenderSettings.swift +import SwiftUI + +/// Live visual settings for AVLiveBody. ContentView observes this and +/// pushes changes to SceneController. Defaults chosen so the scene is +/// lit and everything visible out of the box. +@MainActor +final class RenderSettings: ObservableObject { + // Layer visibility + @Published var showSkeleton: Bool = true + @Published var showMesh: Bool = true + @Published var showVideo: Bool = true + + // Mesh material + @Published var meshMetallic: Bool = false + @Published var meshRoughness: Double = 0.6 + + // Video quad + @Published var videoOpacity: Double = 1.0 + + // Lights (RealityKit DirectionalLight intensities) + @Published var keyIntensity: Double = 4000 + @Published var fillIntensity: Double = 1500 + @Published var rimIntensity: Double = 2000 + + // Camera + @Published var fieldOfView: Double = 55 + + // Panel visibility + @Published var showPanel: Bool = false +} diff --git a/avlivebody-mac/Tests/AVLiveBodyTests/RenderSettingsTests.swift b/avlivebody-mac/Tests/AVLiveBodyTests/RenderSettingsTests.swift new file mode 100644 index 0000000..ac9dcd4 --- /dev/null +++ b/avlivebody-mac/Tests/AVLiveBodyTests/RenderSettingsTests.swift @@ -0,0 +1,21 @@ +// avlivebody-mac/Tests/AVLiveBodyTests/RenderSettingsTests.swift +import XCTest +@testable import AVLiveBody + +@MainActor +final class RenderSettingsTests: XCTestCase { + func testDefaults() { + let s = RenderSettings() + XCTAssertTrue(s.showSkeleton) + XCTAssertTrue(s.showMesh) + XCTAssertTrue(s.showVideo) + XCTAssertFalse(s.meshMetallic) + XCTAssertEqual(s.meshRoughness, 0.6, accuracy: 1e-9) + XCTAssertEqual(s.videoOpacity, 1.0, accuracy: 1e-9) + XCTAssertEqual(s.keyIntensity, 4000, accuracy: 1e-9) + XCTAssertEqual(s.fillIntensity, 1500, accuracy: 1e-9) + XCTAssertEqual(s.rimIntensity, 2000, accuracy: 1e-9) + XCTAssertEqual(s.fieldOfView, 55, accuracy: 1e-9) + XCTAssertFalse(s.showPanel) + } +}