pub struct RtPrimitive { /* private fields */ }Expand description
Bound analytic primitive pairing an RtPrimitiveShape with a material index.
Implementations§
Source§impl RtPrimitive
Analytic ray-primitive intersection and bounding box evaluation for RtPrimitive.
impl RtPrimitive
Analytic ray-primitive intersection and bounding box evaluation for RtPrimitive.
Sourcepub fn intersect(
&self,
ray: &Ray3D,
t_min: f32,
t_max: f32,
primitive_index: u32,
) -> Option<RtHit>
pub fn intersect( &self, ray: &Ray3D, t_min: f32, t_max: f32, primitive_index: u32, ) -> Option<RtHit>
Intersects a world-space ray against this analytic primitive within [t_min, t_max].
§Arguments
&Self- Primitive reference.&Ray3D- World-space normalized ray.f32- Minimum accepted hit distance.f32- Maximum accepted hit distance.u32- Primitive table index recorded on the hit.
§Returns
Option<RtHit>- Analytic intersection hit if any.
Sourcepub fn bounds(&self) -> AxisAlignedBox3D
pub fn bounds(&self) -> AxisAlignedBox3D
Source§impl RtPrimitive
Implements impl #impl_generics #name #ty_generics #where_clause.
impl RtPrimitive
Implements impl #impl_generics #name #ty_generics #where_clause.
pub fn get_shape(&self) -> RtPrimitiveShape
pub fn get_mut_shape(&mut self) -> &mut RtPrimitiveShape
pub fn set_shape(&mut self, val: RtPrimitiveShape) -> &mut Self
pub fn get_material_id(&self) -> u32
pub fn get_mut_material_id(&mut self) -> &mut u32
pub fn set_material_id(&mut self, val: u32) -> &mut Self
Source§impl RtPrimitive
Implements impl #impl_generics #name #ty_generics #where_clause.
impl RtPrimitive
Implements impl #impl_generics #name #ty_generics #where_clause.
pub fn new(shape: RtPrimitiveShape, material_id: u32) -> Self
Trait Implementations§
Source§impl Clone for RtPrimitive
impl Clone for RtPrimitive
impl Copy for RtPrimitive
Source§impl Debug for RtPrimitive
impl Debug for RtPrimitive
Source§impl PartialEq for RtPrimitive
impl PartialEq for RtPrimitive
impl StructuralPartialEq for RtPrimitive
Auto Trait Implementations§
impl Forget for RtPrimitive
impl Freeze for RtPrimitive
impl Move for RtPrimitive
impl RefUnwindSafe for RtPrimitive
impl Send for RtPrimitive
impl Sync for RtPrimitive
impl Unpin for RtPrimitive
impl UnsafeUnpin for RtPrimitive
impl UnwindSafe for RtPrimitive
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