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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
//! # Gizmo Engine
//!
//! `gizmo-engine` is the all-in-one facade crate of the Gizmo game engine. It
//! re-exports the individual subsystem crates (core ECS, math, app loop,
//! physics, renderer, windowing, audio, scene, editor, UI, animation and AI)
//! and adds an ergonomic, Bevy-like convenience layer on top: [`Color`],
//! ready-made [`bundles`], a [`spawner`] API and prefabricated scene helpers.
//!
//! Note that the published *package* is named `gizmo-engine`, while the *library*
//! (and thus the crate path used in `use` statements and examples) is simply
//! `gizmo`. That is declared by `[lib] name = "gizmo"` in the manifest, so
//! `cargo add gizmo-engine` followed by `use gizmo::prelude::*;` works with no
//! rename in your own `Cargo.toml`:
//!
//! ```
//! use gizmo::prelude::*;
//!
//! // The path in every example on this page is the real one.
//! let mut world = World::new();
//! let e = world.spawn();
//! world.add_component(e, Transform::new(Vec3::new(0.0, 1.0, 0.0)));
//! assert_eq!(
//! world.query::<&Transform>().unwrap().get(e.id()).unwrap().position.y,
//! 1.0
//! );
//! ```
//!
//! ## Feature flags
//!
//! Subsystems are gated behind Cargo features so you only compile what you need:
//!
//! - `window` — windowing via `winit`.
//! - `render` — the `wgpu`-based renderer (implies `window`).
//! - `audio` — audio playback.
//! - `physics`, `physics-dynamics`, `physics-soft` — physics subsystems.
//! - `scene` — scene (de)serialization.
//! - `editor` — the `egui`-based in-engine editor (implies `render`).
//! - `ui` — the UI subsystem.
//! - `animation` — skeletal/property animation.
//! - `scripting` — scripting support.
//! - `network` — networking / P2P deterministic rollback via `gizmo-net`.
//! - `headless` — run the app loop without a window (e.g. for servers/tests).
//!
//! The `default` feature enables a full desktop game setup (`window`, `render`,
//! `audio`, `physics`, `scene`, `editor`, `ui`, `animation`, `network`).
//!
//! ## Re-exported third-party crates
//!
//! For convenience the facade re-exports the external crates that appear in its
//! public API so downstream users do not have to add them separately:
//! [`wgpu`] and [`bytemuck`] (with `render`), [`egui`] (with `editor`) and
//! [`winit`] (with `window`).
// Feature gating rule for the facade's own modules:
//
// These used to be unconditional `pub mod`s whose bodies referenced the *optional*
// `gizmo-renderer` / `gizmo-physics-*` dependencies unconditionally, so `gizmo-engine`
// only ever compiled with `render` AND `physics` on — including under its own advertised
// `headless` feature. Gate at the narrowest level that still compiles: a whole module
// where every item needs the dependency, individual items where the split is inside.
//
// `Transform` lives in `gizmo-physics-core`, so anything touching transforms needs the
// `physics` feature — that is why several purely-logical modules are gated on it.
/// GPU asset loading — requires a renderer.
/// Ready-made component bundles. Light/camera/mesh bundles need `render`; the rigid-body
/// bundle needs `physics` (see the per-item gates inside).
/// Entity spawning helpers built on the renderer's mesh/material pipeline. They also spawn
/// rigid bodies, hence the `physics` half of the gate.
// === Motor Alt Sistemleri ===
pub use gizmo_ai as ai;
pub use gizmo_analysis as analysis;
pub use gizmo_app as app;
pub use gizmo_core as core;
pub use gizmo_math as math;
/// Re-exports of the split physics crates under one `gizmo::physics` path.
pub use gizmo_renderer as renderer;
pub use gizmo_window as window;
// Sık kullanılan matematik tiplerini lib.rs'ten doğrudan aç:
pub use ;
pub use *;
// === Opsiyonel Modüller ===
pub use gizmo_audio as audio;
pub use gizmo_editor as editor;
pub use gizmo_scripting as scripting;
pub use gizmo_scene as scene;
// `pub use gizmo_scene::ron;` used to sit here. It went away with `gizmo-scene`'s own
// re-export (2026-08-09): the RON parser is an implementation detail of the scene file
// format, not API. What it was there for — turning a hand-written RON level string into a
// scene — is `scene::SceneData::from_ron_str` / `to_ron_string` now. This facade is Stage B
// and could have kept leaking the parser (docs/ENGINE.md §4), but only by taking a direct
// dependency on it and pinning that pin in lock-step with `gizmo-scene`'s, where a drift
// between the two would hand callers a parser type the `From` impls in `gizmo-scene` do not
// accept.
/// A [`scene::registry::SceneRegistry`] holding every component the enabled feature set
/// can round-trip — not just the physics ones.
///
/// `gizmo-scene` deliberately depends on neither the renderer nor the scripting layer, so
/// that scene save/load works in a GPU-free headless build. The cost is that
/// [`scene::registry::default_scene_registry`] can only register what physics owns:
/// transforms, bodies, colliders and the fighter components. Everything a scene visibly
/// consists of — lights, cameras, audio emitters — lived outside its reach, so saving a
/// scene from the editor and loading it back returned the physics and dropped the rest,
/// silently.
///
/// This is the facade's job, because the facade is the layer that can see all of them. Use
/// it wherever you would otherwise call `default_scene_registry`.
///
/// To round-trip your *own* components, register them on the result — anything that is
/// `Component + Serialize + DeserializeOwned` qualifies:
///
/// ```no_run
/// # use gizmo::scene::scene::SceneData;
/// # #[derive(Clone, serde::Serialize, serde::Deserialize)]
/// # struct Health(f32);
/// # gizmo::core::impl_component!(Health);
/// let mut registry = gizmo::full_scene_registry();
/// registry
/// .register_serializable::<Health>("Health")
/// .expect("name must not collide with a built-in");
/// // `registry` now round-trips Health alongside everything the engine registers.
/// ```
pub use gizmo_ui as ui;
pub use gizmo_animation as animation;
pub use gizmo_net as net;
// === 3. Parti Re-Export (Kullanıcının ayrıca eklemesine gerek kalmasın) ===
pub use gizmo_log;
/// 1.0 contract: the external graphics/window types below (`wgpu`, `bytemuck`,
/// `egui`, `winit`) are deliberately part of the public API. Their versions
/// depend on the semver of the relevant renderer/window crate; a major version
/// bump in these external crates counts as breaking for the facade too.
pub use bytemuck;
/// 1.0 contract: this external graphics type is deliberately part of the public
/// API; its version depends on the semver of the relevant UI crate. It is enabled
/// with the `egui` feature (overlay UI / editor).
pub use egui;
/// 1.0 contract: this external graphics type is deliberately part of the public
/// API; its version depends on the semver of the renderer crate.
pub use wgpu;
/// 1.0 contract: this external window type is deliberately part of the public
/// API; its version depends on the semver of the window crate.
pub use winit;