#[repr(C)]pub struct MPSIntersectionDistancePrimitiveIndex {
pub distance: c_float,
pub primitiveIndex: c_uint,
}Available on crate features
MPSRayIntersector and MPSRayIntersectorTypes only.Expand description
Intersection result which contains the distance from the ray origin to the intersection point and the index of the intersected primitive
This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.
See also Apple’s documentation
Fields§
§distance: c_floatDistance from the ray origin to the intersection point along the ray direction vector such that intersection = ray.origin + ray.direction * distance. Is negative if there is no intersection. If the intersection type is MPSIntersectionTypeAny, is a positive value for a hit or a negative value for a miss.
primitiveIndex: c_uintIndex of the intersected primitive. Undefined if the ray does not intersect a primitive or if the intersection type is MPSIntersectionTypeAny.
Trait Implementations§
Source§impl Clone for MPSIntersectionDistancePrimitiveIndex
impl Clone for MPSIntersectionDistancePrimitiveIndex
Source§fn clone(&self) -> MPSIntersectionDistancePrimitiveIndex
fn clone(&self) -> MPSIntersectionDistancePrimitiveIndex
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl PartialEq for MPSIntersectionDistancePrimitiveIndex
impl PartialEq for MPSIntersectionDistancePrimitiveIndex
Source§fn eq(&self, other: &MPSIntersectionDistancePrimitiveIndex) -> bool
fn eq(&self, other: &MPSIntersectionDistancePrimitiveIndex) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl RefEncode for MPSIntersectionDistancePrimitiveIndex
impl RefEncode for MPSIntersectionDistancePrimitiveIndex
Source§const ENCODING_REF: Encoding
const ENCODING_REF: Encoding
The Objective-C type-encoding for a reference of this type. Read more
impl Copy for MPSIntersectionDistancePrimitiveIndex
impl StructuralPartialEq for MPSIntersectionDistancePrimitiveIndex
Auto Trait Implementations§
impl Freeze for MPSIntersectionDistancePrimitiveIndex
impl RefUnwindSafe for MPSIntersectionDistancePrimitiveIndex
impl Send for MPSIntersectionDistancePrimitiveIndex
impl Sync for MPSIntersectionDistancePrimitiveIndex
impl Unpin for MPSIntersectionDistancePrimitiveIndex
impl UnsafeUnpin for MPSIntersectionDistancePrimitiveIndex
impl UnwindSafe for MPSIntersectionDistancePrimitiveIndex
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> EncodeArgument for Twhere
T: Encode,
impl<T> EncodeArgument for Twhere
T: Encode,
Source§const ENCODING_ARGUMENT: Encoding = T::ENCODING
const ENCODING_ARGUMENT: Encoding = T::ENCODING
The Objective-C type-encoding for this type.
Source§impl<T> EncodeReturn for Twhere
T: Encode,
impl<T> EncodeReturn for Twhere
T: Encode,
Source§const ENCODING_RETURN: Encoding = T::ENCODING
const ENCODING_RETURN: Encoding = T::ENCODING
The Objective-C type-encoding for this type.