#[non_exhaustive]pub struct InstanceRef<'a> {
pub source: usize,
pub transform: &'a [f64; 16],
}Expand description
One instance, borrowing the matrix the scene already holds.
Scene::instance_transforms copies: for a set-dressing
instancer with a million entries that is 136 MB of Instance
against the 128 MB doublematrix array it was copied from.
Scene::instances hands out these instead, which is the shape a
renderer’s own instancer wants – a prototype index and a matrix it
can read in place.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.source: usizeWhich prototype this instance draws, as a position in
Scene::instance_sources.
transform: &'a [f64; 16]This instance’s transform, in the instances node’s space.
Trait Implementations§
Source§impl<'a> Clone for InstanceRef<'a>
impl<'a> Clone for InstanceRef<'a>
impl<'a> Copy for InstanceRef<'a>
Source§impl<'a> Debug for InstanceRef<'a>
impl<'a> Debug for InstanceRef<'a>
Source§impl<'a> PartialEq for InstanceRef<'a>
impl<'a> PartialEq for InstanceRef<'a>
impl<'a> StructuralPartialEq for InstanceRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for InstanceRef<'a>
impl<'a> RefUnwindSafe for InstanceRef<'a>
impl<'a> Send for InstanceRef<'a>
impl<'a> Sync for InstanceRef<'a>
impl<'a> Unpin for InstanceRef<'a>
impl<'a> UnsafeUnpin for InstanceRef<'a>
impl<'a> UnwindSafe for InstanceRef<'a>
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