1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
//! Eulumdat 3D Scene Viewer Library
//!
//! This crate provides Bevy-based photometric lighting visualization.
//!
//! # Architecture
//!
//! The crate is organized into two main modules:
//!
//! - [`photometric`] - Generic photometric lighting for any Bevy application
//! - `viewer` - Demo application with pre-built scenes and controls (requires `viewer` feature)
//!
//! # Feature Flags
//!
//! - `photometric` - Generic photometric lighting (minimal dependencies)
//! - `viewer` - Full demo application with scenes, camera, controls (implies `photometric`)
//! - `wasm-sync` - localStorage polling for WASM hot-reload (implies `viewer`)
//! - `standalone` - Enable standalone binary (implies `wasm-sync`)
//!
//! # Usage as a Generic Photometric Plugin
//!
//! For embedding photometric lights in your own Bevy application:
//!
//! ```ignore
//! use bevy::prelude::*;
//! use eulumdat_bevy::photometric::*;
//! use eulumdat_bevy::{EulumdatLight, EulumdatLightBundle};
//!
//! fn main() {
//! App::new()
//! .add_plugins(DefaultPlugins)
//! .add_plugins(PhotometricPlugin::<eulumdat::Eulumdat>::default())
//! .add_systems(Startup, setup)
//! .run();
//! }
//!
//! fn setup(mut commands: Commands) {
//! // Your own camera
//! commands.spawn(Camera3dBundle { ... });
//!
//! // Your own scene geometry
//! commands.spawn(PbrBundle { ... });
//!
//! // Spawn a photometric light
//! let ldt = eulumdat::Eulumdat::from_file("light.ldt").unwrap();
//! commands.spawn(EulumdatLightBundle::new(ldt)
//! .with_transform(Transform::from_xyz(0.0, 3.0, 0.0)));
//! }
//! ```
//!
//! # Usage as a Demo Viewer
//!
//! For the full demo experience with pre-built scenes:
//!
//! ```ignore
//! use bevy::prelude::*;
//! use eulumdat_bevy::viewer::*;
//!
//! fn main() {
//! App::new()
//! .add_plugins(DefaultPlugins)
//! .add_plugins(EulumdatViewerPlugin::default())
//! .run();
//! }
//! ```
//!
//! # Implementing PhotometricData for Custom Types
//!
//! To use photometric lighting with your own data format:
//!
//! ```ignore
//! use eulumdat_bevy::photometric::PhotometricData;
//!
//! impl PhotometricData for MyLightData {
//! fn sample(&self, c_angle: f64, g_angle: f64) -> f64 { ... }
//! fn max_intensity(&self) -> f64 { ... }
//! // ... implement other required methods
//! }
//!
//! // Then use PhotometricPlugin with your type:
//! app.add_plugins(PhotometricPlugin::<MyLightData>::default());
//! ```
// Generic photometric module (always available)
// Eulumdat-specific implementation (always available)
pub use ;
// Viewer module (only with "viewer" feature)
// Re-export commonly used types at crate root for convenience
pub use ;
// Re-export viewer types at crate root when available
pub use ;
// Legacy compatibility: re-export old names
pub use ViewerSettings as SceneSettings;
// ============================================================================
// Standalone app functions (for running as a separate binary)
// ============================================================================
/// Run the 3D viewer on a specific canvas element (WASM).
///
/// # Arguments
/// * `canvas_selector` - CSS selector for the canvas element (e.g., "#bevy-canvas")
/// Run the 3D viewer as a native window (desktop).