ITADN

Add `get_point` helper to `RayCaster`

#968OpenShatur 创建于 2026-04-11
C-FeatureA-Spatial-QueryD-TrivialS-Ready-For-Implementation
S
Shaturcommented
Right now to get position users need to take origin, add direction and multiply by distance: ```rust fn print_hits(query: Query<(&RayCaster, &RayHits)>) { for (ray, hits) in &query { for hit in hits.iter() { println!( "Hit entity {} at {}", hit.entity, ray.origin + *ray.direction * hit.distance, ); } } } ``` But it would be nice to have a helper like [`Ray3d::get_point`](https://docs.rs/bevy/latest/bevy/prelude/struct.Ray2d.html#method.get_point).
0 条评论