//! This example demonstrates how to use the [`Raycast`] system param to chain multiple raycasts and //! bounce off of surfaces. use std::f32::consts::{FRAC_PI_2, PI}; use bevy::{color::palettes::css, core_pipeline::bloom::BloomSettings, math::vec3, prelude::*}; use bevy_mod_raycast::prelude::*; fn main() { App::new() .add_plugins(( DefaultPlugins.set(bevy_mod_raycast::low_latency_window_plugin()), CursorRayPlugin, )) .add_systems(Startup, setup_scene) .add_systems(Update, bouncing_raycast) .insert_resource(ClearColor(Color::BLACK)) .run(); } const MAX_BOUNCES: usize = 64; const LASER_SPEED: f32 = 0.03; #[derive(Reflect)] struct Laser; fn bouncing_raycast( mut raycast: Raycast, mut gizmos: Gizmos, time: Res