pub struct Ray<V: VectorSpace> {
pub origin: V,
pub direction: V,
}Expand description
A ray defined by an origin point and a direction vector.
Fields§
§origin: VThe starting point of the ray.
direction: VThe direction the ray extends in.
Implementations§
Source§impl<V: Copy + InnerSpace> Ray<V>
impl<V: Copy + InnerSpace> Ray<V>
Sourcepub fn intersect_sphere(
&self,
center: V,
radius: V::Scalar,
) -> Option<(V::Scalar, CollisionInfo<V>)>
pub fn intersect_sphere( &self, center: V, radius: V::Scalar, ) -> Option<(V::Scalar, CollisionInfo<V>)>
Intersects this ray with a sphere defined by center and radius. Returns the ray parameter and collision info if the ray hits the sphere.
Trait Implementations§
impl<V: Copy + VectorSpace> Copy for Ray<V>
Auto Trait Implementations§
impl<V> Freeze for Ray<V>where
V: Freeze,
impl<V> RefUnwindSafe for Ray<V>where
V: RefUnwindSafe,
impl<V> Send for Ray<V>where
V: Send,
impl<V> Sync for Ray<V>where
V: Sync,
impl<V> Unpin for Ray<V>where
V: Unpin,
impl<V> UnsafeUnpin for Ray<V>where
V: UnsafeUnpin,
impl<V> UnwindSafe for Ray<V>where
V: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more