Skip to main content

Crate gizmo

Crate gizmo 

Source
Expand description

§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).

Re-exports§

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;
pub use gizmo_renderer as renderer;
pub use gizmo_window as window;
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_ui as ui;
pub use gizmo_animation as animation;
pub use gizmo_net as net;
pub use bytemuck;
pub use egui;
pub use wgpu;
pub use winit;
pub use simple::*;

Modules§

asset_server
GPU asset loading — requires a renderer.
bundles
Ready-made component bundles. Light/camera/mesh bundles need render; the rigid-body bundle needs physics (see the per-item gates inside). Bevy-style predefined Bundle structures.
color
physics
Re-exports of the split physics crates under one gizmo::physics path. Gizmo Physics Module Re-exports This module provides backward-compatible exports for the split physics crates.
plugins
prelude
simple
spawner
Entity spawning helpers built on the renderer’s mesh/material pipeline. They also spawn rigid bodies, hence the physics half of the gate. Bevy-like Command API — for spawning an object in a single line inside the setup closure.
systems

Macros§

gizmo_log
Global Logger Macro — source location information is added automatically.

Structs§

Mat4
A 4x4 column major matrix.
Quat
A quaternion representing an orientation.
Vec2
A 2-dimensional vector.
Vec3
A 3-dimensional vector.
Vec4
A 4-dimensional vector.

Functions§

full_scene_registry
A scene::registry::SceneRegistry holding every component the enabled feature set can round-trip — not just the physics ones.