Skip to main content

TraceRay

Struct TraceRay 

Source
pub struct TraceRay<'a> {
    pub scene: ResourceId,
    pub flags: u32,
    pub mask: u32,
    pub hit_group_offset: u32,
    pub hit_group_stride: u32,
    pub miss_index: u32,
    pub origin: [f32; 3],
    pub t_min: f32,
    pub direction: [f32; 3],
    pub t_max: f32,
    pub payload: &'a mut [u32],
}
Expand description

TraceRay: a ray shot into an acceleration structure. The payload is the words of the program’s payload structure, which the programs the ray runs read and write; the caller leaves it as the ray’s last program did.

Fields§

§scene: ResourceId

The interface resource of the acceleration structure.

§flags: u32

The ray’s flags (crate::ray_flags).

§mask: u32

The instance inclusion mask: an instance is seen when it shares a bit with it.

§hit_group_offset: u32

RayContributionToHitGroupIndex: added to the hit group index.

§hit_group_stride: u32

MultiplierForGeometryContributionToHitGroupIndex: the geometry index is multiplied by it.

§miss_index: u32

MissShaderIndex: which miss program runs if nothing is hit.

§origin: [f32; 3]

The ray’s origin in world space.

§t_min: f32

The nearest distance along the ray that counts as a hit.

§direction: [f32; 3]

The ray’s direction in world space.

§t_max: f32

The farthest distance along the ray that counts as a hit.

§payload: &'a mut [u32]

The words of the payload structure.

Trait Implementations§

Source§

impl<'a> Debug for TraceRay<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !UnwindSafe for TraceRay<'a>

§

impl<'a> Freeze for TraceRay<'a>

§

impl<'a> RefUnwindSafe for TraceRay<'a>

§

impl<'a> Send for TraceRay<'a>

§

impl<'a> Sync for TraceRay<'a>

§

impl<'a> Unpin for TraceRay<'a>

§

impl<'a> UnsafeUnpin for TraceRay<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.