Skip to content

Add get_point helper to RayCaster #968

@Shatur

Description

@Shatur

Right now to get position users need to take origin, add direction and multiply by distance:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-Spatial-QueryRelates to spatial queries, such as ray casting, shape casting, and intersection testsC-FeatureA new feature, making something new possibleD-TrivialNice and straightforward! A great choice to get started with AvianS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions