pub struct RenderItem {Show 16 fields
pub id: u64,
pub transform: Mat4,
pub mesh_handle: u64,
pub material_index: u32,
pub sort_key: MaterialSortKey,
pub camera_distance: f32,
pub bucket: RenderBucket,
pub visible: bool,
pub bounds_center: [f32; 3],
pub bounds_radius: f32,
pub instance_count: u32,
pub instance_buffer: u64,
pub vertex_count: u32,
pub index_count: u32,
pub alpha_test: bool,
pub two_sided: bool,
}Expand description
A single item to be rendered.
Fields§
§id: u64Unique identifier for this item.
transform: Mat4World transform.
mesh_handle: u64Mesh/geometry handle (opaque).
material_index: u32Material index into the material library.
sort_key: MaterialSortKeyMaterial sort key for batching.
camera_distance: f32Distance from camera (computed during sorting).
bucket: RenderBucketWhich bucket this item belongs to.
visible: boolWhether this item is visible (frustum culling result).
bounds_center: [f32; 3]Bounding sphere center (world space).
bounds_radius: f32Bounding sphere radius.
instance_count: u32Instance count (for instanced rendering, 1 = no instancing).
instance_buffer: u64Instance data buffer handle (if instanced).
vertex_count: u32Vertex count (for stats).
index_count: u32Index count (for stats).
alpha_test: boolWhether this item uses alpha testing (cutout).
two_sided: boolWhether this item is two-sided (no backface culling).
Implementations§
Source§impl RenderItem
impl RenderItem
pub fn new(id: u64, mesh_handle: u64, material_index: u32) -> Self
pub fn with_transform(self, t: Mat4) -> Self
pub fn with_bucket(self, b: RenderBucket) -> Self
pub fn with_bounds(self, center: [f32; 3], radius: f32) -> Self
Sourcepub fn compute_camera_distance(&mut self, camera_pos: [f32; 3])
pub fn compute_camera_distance(&mut self, camera_pos: [f32; 3])
Compute the distance from a camera position.
Trait Implementations§
Source§impl Clone for RenderItem
impl Clone for RenderItem
Source§fn clone(&self) -> RenderItem
fn clone(&self) -> RenderItem
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RenderItem
impl RefUnwindSafe for RenderItem
impl Send for RenderItem
impl Sync for RenderItem
impl Unpin for RenderItem
impl UnsafeUnpin for RenderItem
impl UnwindSafe for RenderItem
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.