pub struct RenderQueue {
pub buckets: HashMap<RenderBucket, Vec<RenderItem>>,
pub sort_modes: HashMap<RenderBucket, SortMode>,
pub camera_position: [f32; 3],
pub frustum_planes: [[f32; 4]; 6],
pub total_submitted: u32,
pub total_visible: u32,
pub total_culled: u32,
/* private fields */
}Expand description
Collects and sorts render items into buckets for the pipeline passes.
Fields§
§buckets: HashMap<RenderBucket, Vec<RenderItem>>All render items, partitioned by bucket.
sort_modes: HashMap<RenderBucket, SortMode>Sort modes per bucket (overridable).
camera_position: [f32; 3]Camera position used for distance-based sorting.
frustum_planes: [[f32; 4]; 6]Frustum planes for culling [left, right, bottom, top, near, far].
total_submitted: u32Total items submitted this frame.
total_visible: u32Total items visible after culling.
total_culled: u32Total items culled.
Implementations§
Source§impl RenderQueue
impl RenderQueue
pub fn new() -> Self
Sourcepub fn set_camera(&mut self, position: [f32; 3], frustum_planes: [[f32; 4]; 6])
pub fn set_camera(&mut self, position: [f32; 3], frustum_planes: [[f32; 4]; 6])
Set the camera position and frustum for this frame.
Sourcepub fn submit(&mut self, item: RenderItem)
pub fn submit(&mut self, item: RenderItem)
Submit a render item to the queue.
Sourcepub fn submit_batch(&mut self, items: Vec<RenderItem>)
pub fn submit_batch(&mut self, items: Vec<RenderItem>)
Submit a batch of render items.
Sourcepub fn get_bucket(&self, bucket: RenderBucket) -> &[RenderItem]
pub fn get_bucket(&self, bucket: RenderBucket) -> &[RenderItem]
Get items in a specific bucket (sorted).
Sourcepub fn opaque_items(&self) -> &[RenderItem]
pub fn opaque_items(&self) -> &[RenderItem]
Get opaque items (convenience).
Sourcepub fn transparent_items(&self) -> &[RenderItem]
pub fn transparent_items(&self) -> &[RenderItem]
Get transparent items (convenience).
Sourcepub fn overlay_items(&self) -> &[RenderItem]
pub fn overlay_items(&self) -> &[RenderItem]
Get overlay items (convenience).
Sourcepub fn total_triangles(&self) -> u64
pub fn total_triangles(&self) -> u64
Return the total number of triangles across all visible items.
Sourcepub fn total_draw_calls(&self) -> u32
pub fn total_draw_calls(&self) -> u32
Return the total number of draw calls across all visible items.
Trait Implementations§
Source§impl Debug for RenderQueue
impl Debug for RenderQueue
Auto Trait Implementations§
impl Freeze for RenderQueue
impl RefUnwindSafe for RenderQueue
impl Send for RenderQueue
impl Sync for RenderQueue
impl Unpin for RenderQueue
impl UnsafeUnpin for RenderQueue
impl UnwindSafe for RenderQueue
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> 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.