### Setup GlizmoPlugin in Bevy Application Source: https://context7.com/atlv24/glizmo/llms.txt This code demonstrates how to add the GlizmoPlugin to a Bevy application. This is necessary to enable the immediate-mode gizmo drawing functionalities. It also shows a basic example of calling a glizmo function within game logic. ```rust use bevy::prelude::*; use glizmo::GlizmoPlugin; fn main() { App::new() .add_plugins(DefaultPlugins) .add_plugins(GlizmoPlugin) .add_systems(Update, my_game_logic) .run(); } fn my_game_logic() { // Now you can call glizmo functions anywhere glizmo::sphere(Vec3::ZERO, 1.0, Color::srgb(1.0, 0.0, 0.0)); } ``` -------------------------------- ### Complete Usage Example: Bevy Game with Glizmo Source: https://context7.com/atlv24/glizmo/llms.txt This example demonstrates how to integrate and use various glizmo functions within a Bevy game loop. It showcases drawing axes, velocity vectors, rays, spheres, AABBs, and a grid. Dependencies include Bevy engine and its default plugins. ```rust use bevy::{color::palettes::css::*, prelude::*}; use std::f32::consts::PI; fn main() { App::new() .add_plugins((DefaultPlugins, glizmo::GlizmoPlugin)) .add_systems(Startup, setup) .add_systems(Update, ( debug_player_system, debug_physics_system, draw_debug_grid, )) .run(); } fn setup( mut commands: Commands, mut meshes: ResMut>, mut materials: ResMut>, ) { commands.spawn(( Camera3d::default(), Transform::from_xyz(-5.0, 5.0, 10.0).looking_at(Vec3::ZERO, Vec3::Y), )); commands.spawn(( Mesh3d(meshes.add(Plane3d::default().mesh().size(20.0, 20.0))), MeshMaterial3d(materials.add(Color::srgb(0.3, 0.5, 0.3))), )); commands.spawn(( PointLight { intensity: 2_000_000.0, shadows_enabled: true, ..default() }, Transform::from_xyz(4.0, 8.0, 4.0), )); } #[derive(Component)] struct Player { velocity: Vec3, look_direction: Vec3, } fn debug_player_system( query: Query<(&Transform, &Player)>, time: Res