# raylite Lightweight, 0-dependency raycasting in Rust 🔧**WIP: _Very_ early in development, feel free to post issues/contribute!** [Crates.io](https://crates.io/crates/raylite/) ## 🚀 Installation Install using cargo: `cargo add raylite` ## ðŸŠķ Example **main.rs:** ```rust use raylite::{cast, Barrier, Ray}; fn main() { // Positions are differentiated here because emission direction matters let ray = Ray { position: (0., 0.), // Emission origin position end_position: (2., 0.), // Emission end position }; let mut bar = Barrier { positions: ((1., -1.), (1., 1.)), // Direction does not matter for Barriers }; let result = cast(&ray, &bar); // Returns a Result assert!(result.is_ok()); // Result is an Ok containing hit info bar = Barrier { positions: ((-1., -1.), (-1., 1.)), // Place barrier behind the Ray }; let result = cast(&ray, &bar); assert!(result.is_err()); // Result is an Err } ``` `cast_wide()` provides the same functionality as `cast()`, but requires you to provide a `&Vec` for batching purposes.