Skip to main content

Clip

Trait Clip 

Source
pub trait Clip {
    // Required method
    fn raycast(&self, ray: &Ray<Vector<f32>>, max_distance: f32) -> Option<f32>;
}
Expand description

A source of geometry the camera can clip against.

Implemented for any collision world that can cast a ray and return the distance to the nearest hit within max_distance. With the collide-mesh feature this is implemented for [collide_mesh::CollisionWorld].

Required Methods§

Source

fn raycast(&self, ray: &Ray<Vector<f32>>, max_distance: f32) -> Option<f32>

Casts ray and returns the distance to the nearest hit no farther than max_distance, or None if nothing is hit.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§