//! This example demonstrates how to use the [`Raycast`] system param to run raycasts on-demand, in //! an immediate mode style. This is unlike using a deferred API, which runs a raycast based on //! [`RaycastSource`] components once per frame. use bevy::prelude::*; use bevy_mod_raycast::prelude::*; fn main() { App::new() .add_plugins(DefaultPlugins) .add_systems(Startup, setup) .add_systems(Update, raycast) .run(); } const RAY_DIST: Vec3 = Vec3::new(0.0, 0.0, -7.0); fn raycast(mut raycast: Raycast, mut gizmos: Gizmos, time: Res