pub struct GridRenderer {
pub enabled: bool,
pub cell_size: f32,
pub major_every: u32,
pub color_minor: Vec4,
pub color_major: Vec4,
pub color_origin: Vec4,
pub fade_start: f32,
pub fade_end: f32,
pub y_plane: f32,
}Expand description
Configuration and rendering logic for the infinite editor grid.
Fields§
§enabled: bool§cell_size: f32§major_every: u32§color_minor: Vec4§color_major: Vec4§color_origin: Vec4§fade_start: f32§fade_end: f32§y_plane: f32Implementations§
Source§impl GridRenderer
impl GridRenderer
pub fn new() -> Self
Sourcepub fn fade_alpha(&self, distance: f32) -> f32
pub fn fade_alpha(&self, distance: f32) -> f32
Compute alpha fade factor at a given distance from the camera.
Sourcepub fn build_lines(
&self,
camera_pos: Vec3,
half_extent: f32,
) -> Vec<(Vec3, Vec3, Vec4)>
pub fn build_lines( &self, camera_pos: Vec3, half_extent: f32, ) -> Vec<(Vec3, Vec3, Vec4)>
Returns a list of grid lines within the visible region. Each line is (start: Vec3, end: Vec3, color: Vec4).
Sourcepub fn render_ascii(&self, width: usize, height: usize) -> String
pub fn render_ascii(&self, width: usize, height: usize) -> String
Render grid as ASCII art for debug/console output.
Trait Implementations§
Source§impl Clone for GridRenderer
impl Clone for GridRenderer
Source§fn clone(&self) -> GridRenderer
fn clone(&self) -> GridRenderer
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 moreSource§impl Debug for GridRenderer
impl Debug for GridRenderer
Auto Trait Implementations§
impl Freeze for GridRenderer
impl RefUnwindSafe for GridRenderer
impl Send for GridRenderer
impl Sync for GridRenderer
impl Unpin for GridRenderer
impl UnsafeUnpin for GridRenderer
impl UnwindSafe for GridRenderer
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