pub struct RtInstance { /* private fields */ }Expand description
Instanced reference to a shared Blas3D with affine transform, cached inverse, normal matrix, and material binding.
Implementations§
Source§impl RtInstance
Transform precomputation and update helpers for RtInstance.
impl RtInstance
Transform precomputation and update helpers for RtInstance.
Sourcepub fn new(
blas_id: u32,
transform: Mat4,
material_id: u32,
local_bounds: AxisAlignedBox3D,
) -> Self
pub fn new( blas_id: u32, transform: Mat4, material_id: u32, local_bounds: AxisAlignedBox3D, ) -> Self
Creates an instanced BLAS reference with precomputed inverse matrix, normal matrix, and world bounding box.
§Arguments
u32- Index of the referencedBlas3D.Mat4- Local-to-world affine transform matrix.u32- Bound material index.AxisAlignedBox3D- Local-space bounding box of the referencedBlas3D.
§Returns
Self- Ready-to-trace scene instance.
Sourcepub fn update_transform(
&mut self,
transform: Mat4,
local_bounds: AxisAlignedBox3D,
)
pub fn update_transform( &mut self, transform: Mat4, local_bounds: AxisAlignedBox3D, )
Recomputes the inverse transform, normal matrix, and world bounding box for a moved or scaled instance.
§Arguments
&Self- Mutable instance reference.Mat4- Updated local-to-world affine transform matrix.AxisAlignedBox3D- Local-space bounding box of the referencedBlas3D.
Source§impl RtInstance
Implements impl #impl_generics #name #ty_generics #where_clause.
impl RtInstance
Implements impl #impl_generics #name #ty_generics #where_clause.
pub fn get_blas_id(&self) -> u32
pub fn get_mut_blas_id(&mut self) -> &mut u32
pub fn set_blas_id(&mut self, val: u32) -> &mut Self
pub fn get_transform(&self) -> Mat4
pub fn get_mut_transform(&mut self) -> &mut Mat4
pub fn set_transform(&mut self, val: Mat4) -> &mut Self
pub fn get_inv_transform(&self) -> Mat4
pub fn get_mut_inv_transform(&mut self) -> &mut Mat4
pub fn set_inv_transform(&mut self, val: Mat4) -> &mut Self
pub fn get_normal_matrix(&self) -> [Vec3; 3]
pub fn get_mut_normal_matrix(&mut self) -> &mut [Vec3; 3]
pub fn set_normal_matrix(&mut self, val: [Vec3; 3]) -> &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
pub fn get_world_bounds(&self) -> AxisAlignedBox3D
pub fn get_mut_world_bounds(&mut self) -> &mut AxisAlignedBox3D
pub fn set_world_bounds(&mut self, val: AxisAlignedBox3D) -> &mut Self
pub fn get_visible(&self) -> bool
pub fn get_mut_visible(&mut self) -> &mut bool
pub fn set_visible(&mut self, val: bool) -> &mut Self
pub fn get_determinant_sign(&self) -> f32
pub fn get_mut_determinant_sign(&mut self) -> &mut f32
pub fn set_determinant_sign(&mut self, val: f32) -> &mut Self
Trait Implementations§
Source§impl Clone for RtInstance
impl Clone for RtInstance
impl Copy for RtInstance
Source§impl Debug for RtInstance
impl Debug for RtInstance
Source§impl PartialEq for RtInstance
impl PartialEq for RtInstance
impl StructuralPartialEq for RtInstance
Auto Trait Implementations§
impl Forget for RtInstance
impl Freeze for RtInstance
impl Move for RtInstance
impl RefUnwindSafe for RtInstance
impl Send for RtInstance
impl Sync for RtInstance
impl Unpin for RtInstance
impl UnsafeUnpin for RtInstance
impl UnwindSafe for RtInstance
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