pub struct RayCastResult<B: Backend, const N: usize> { /* private fields */ }
Expand description
Results from ray casting operations containing intersection data.
Contains the computed intersection points, distances, field values, and region information for a batch of rays cast against scalar field isosurfaces.
Implementations§
Source§impl<B: Backend, const N: usize> RayCastResult<B, N>
impl<B: Backend, const N: usize> RayCastResult<B, N>
Sourcepub fn new(
rays: Rays<B, N>,
extensions: Origins<B, N>,
field_values: Scalars<B>,
region_indices: Tensor<B, 1>,
) -> Self
pub fn new( rays: Rays<B, N>, extensions: Origins<B, N>, field_values: Scalars<B>, region_indices: Tensor<B, 1>, ) -> Self
Creates a new ray cast result with automatic distance computation.
Distances are computed from ray origins to extension points.
Sourcepub fn distances(&self) -> Scalars<B>
pub fn distances(&self) -> Scalars<B>
Returns the computed distances from ray origins to intersection points.
Sourcepub fn field_values(&self) -> Scalars<B>
pub fn field_values(&self) -> Scalars<B>
Returns the field values at intersection points.
Sourcepub fn extensions(&self) -> Origins<B, N>
pub fn extensions(&self) -> Origins<B, N>
Returns the ray intersection points (extensions).
Sourcepub fn hits_on_surface(&self) -> Origins<B, N>
pub fn hits_on_surface(&self) -> Origins<B, N>
Returns only the intersection points that lie exactly on the surface.
Filters extensions to include only points where the field value is zero.
Sourcepub fn region_indices(&self) -> Tensor<B, 1>
pub fn region_indices(&self) -> Tensor<B, 1>
Returns the region indices identifying which surfaces were hit.
Source§impl<B: Backend, const N: usize> RayCastResult<B, N>
impl<B: Backend, const N: usize> RayCastResult<B, N>
Sourcepub fn to_trajectory(&self, steps: usize) -> Trajectories<B, N>
pub fn to_trajectory(&self, steps: usize) -> Trajectories<B, N>
Convert a RayCastResult to a trajectory sequence for animation All rays move at a constant speed per frame until they hit their target or until the furthest successful ray has stopped moving
Trait Implementations§
Auto Trait Implementations§
impl<B, const N: usize> Freeze for RayCastResult<B, N>where
<B as Backend>::FloatTensorPrimitive: Freeze,
<B as Backend>::QuantizedTensorPrimitive: Freeze,
impl<B, const N: usize> RefUnwindSafe for RayCastResult<B, N>where
<B as Backend>::FloatTensorPrimitive: RefUnwindSafe,
<B as Backend>::QuantizedTensorPrimitive: RefUnwindSafe,
impl<B, const N: usize> Send for RayCastResult<B, N>
impl<B, const N: usize> Sync for RayCastResult<B, N>
impl<B, const N: usize> Unpin for RayCastResult<B, N>
impl<B, const N: usize> UnwindSafe for RayCastResult<B, N>where
<B as Backend>::FloatTensorPrimitive: UnwindSafe,
<B as Backend>::QuantizedTensorPrimitive: 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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more