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
//! Static scene editor — orbit camera, transform gizmos, object inspector.
//!
//! # Architecture
//!
//! The editor subsystem is organised into four sub-modules:
//!
//! | Module | Contents |
//! |---------------------|--------------------------------------------------------------------|
//! | [`types`] | Data types and events ([`EditorEvent`], [`EditorStateEvent`], …) |
//! | [`state`] | [`EditorState`] — all runtime state and input-processing logic |
//! | [`gizmo`] | Translate / rotate / scale gizmo and selection-box mesh builders |
//! | `math` *(internal)* | Ray-cast, AABB, hierarchy, and vector helpers |
//!
//! # Quick start
//!
//! ```rust,ignore
//! // Enable editor mode from on_startup:
//! scene.enable_editor_mode();
//! ```
//!
//! # Responding to editor state changes
//!
//! Register a callback with [`crate::window::Window::on_editor_event`]:
//!
//! ```rust,ignore
//! .on_editor_event(|_state, _scene, event, obj| {
//! let name = obj.as_ref().map(|o| o.name.as_str()).unwrap_or("–");
//! match event {
//! EditorStateEvent::GizmoModeChanged(mode) =>
//! println!("Gizmo → {mode:?} (selected: {name})"),
//! EditorStateEvent::DragStart { axis } =>
//! println!("Drag on {axis:?} (obj: {name})"),
//! EditorStateEvent::DragEnd =>
//! println!("Drag ended (obj: {name})"),
//! }
//! })
//! ```
//!
//! > **Note:** [`on_update`](crate::window::Window::on_update),
//! > [`on_fixed_update`](crate::window::Window::on_fixed_update), and
//! > [`on_draw_request`](crate::window::Window::on_draw_request) are
//! > automatically suppressed while editor mode is active.
pub
pub use ;
pub use EditorState;
pub use ;