pub struct ClusterGrid {
pub tiles_x: u32,
pub tiles_y: u32,
/* private fields */
}Expand description
Bildschirm-Kachelraster × logarithmische Tiefenscheiben.
Fields§
§tiles_x: u32Kacheln waagerecht.
tiles_y: u32Kacheln senkrecht.
Implementations§
Source§impl ClusterGrid
impl ClusterGrid
Sourcepub fn new(tiles_x: u32, tiles_y: u32, slices: u32, near: f32, far: f32) -> Self
pub fn new(tiles_x: u32, tiles_y: u32, slices: u32, near: f32, far: f32) -> Self
Raster mit tiles_x·tiles_y Kacheln und slices Scheiben über
near..far. Alle Achsen mindestens 1; far <= near wird
auf near · 1.001 gehoben.
Sourcepub fn for_render_size(
render_size: [u32; 2],
tile_size: u32,
slices: u32,
near: f32,
far: f32,
) -> Self
pub fn for_render_size( render_size: [u32; 2], tile_size: u32, slices: u32, near: f32, far: f32, ) -> Self
Kachelraster für eine Rendergröße: tiles = ceil(size / tile_size),
mindestens 1 je Achse.
Sourcepub fn slice_count(&self) -> u32
pub fn slice_count(&self) -> u32
Anzahl Tiefenscheiben.
Sourcepub fn cluster_count(&self) -> u32
pub fn cluster_count(&self) -> u32
Gesamtzahl Cluster.
Sourcepub fn slice_bounds(&self, slice: u32) -> Option<(f32, f32)>
pub fn slice_bounds(&self, slice: u32) -> Option<(f32, f32)>
Grenzen der Scheibe slice als (near, far) dieser Scheibe.
Sourcepub fn index(&self, tile_x: u32, tile_y: u32, slice: u32) -> u32
pub fn index(&self, tile_x: u32, tile_y: u32, slice: u32) -> u32
Linearer Cluster-Index: x am schnellsten, dann y, dann Scheibe — benachbarte Kacheln liegen also beieinander (gutmütig für Speicherzugriff-Muster auf der GPU).
Sourcepub fn coords(&self, index: u32) -> Option<(u32, u32, u32)>
pub fn coords(&self, index: u32) -> Option<(u32, u32, u32)>
Umkehrung von Self::index. None außerhalb des Rasters.
Trait Implementations§
Source§impl Clone for ClusterGrid
impl Clone for ClusterGrid
Source§fn clone(&self) -> ClusterGrid
fn clone(&self) -> ClusterGrid
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ClusterGrid
impl Debug for ClusterGrid
Source§impl PartialEq for ClusterGrid
impl PartialEq for ClusterGrid
Source§fn eq(&self, other: &ClusterGrid) -> bool
fn eq(&self, other: &ClusterGrid) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ClusterGrid
Auto Trait Implementations§
impl Freeze for ClusterGrid
impl RefUnwindSafe for ClusterGrid
impl Send for ClusterGrid
impl Sync for ClusterGrid
impl Unpin for ClusterGrid
impl UnsafeUnpin for ClusterGrid
impl UnwindSafe for ClusterGrid
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