Add `get_point` helper to `RayCaster`
C-FeatureA-Spatial-QueryD-TrivialS-Ready-For-Implementation
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 条评论