Impact-rs
This crate provides utilities for performing collision queries between rectangles and rays,
including swept checks for moving rectangles. It leverages fixed-point arithmetic provided by the fixed32 crate to
handle the computations.
Features
- Ray vs. Rect Collision Detection: Detect collisions between a ray and a rectangle, returning contact point, contact normal,
and the closest time of collision. - Swept Rectangle Collision: Check for potential collisions as one rectangle moves towards another, using both horizontal and vertical sweeps.
- Fixed-Point Precision: Uses fixed-point numbers (
Fp) from thefixed32crate for precise calculations without floating-point errors.
Usage
To use this crate in your project, add it to your Cargo.toml:
[]
= "0.0.11"
Example
use Fp;
use ;
use ray_vs_rect;