pub struct Grid3D {
    pub transform: Transform3D,
    pub cell_size: f64,
    pub cell_count: usize,
    pub fill_char: ColChar,
    /* private fields */
}
Expand description

A flat grid to display where the ground is

Fields§

§transform: Transform3D§cell_size: f64

The length of each cell’s width and depth

§cell_count: usize

The number of cells alon each side. The total number of cells will be cell_count^2

§fill_char: ColChar

Implementations§

source§

impl Grid3D

source

pub fn new(cell_size: f64, cell_count: usize, fill_char: ColChar) -> Grid3D

Create a new grid with the specified cell size and count

source

pub fn reload(&mut self)

Regenerate the grid. Call this if you at any point change the cell_size or cell_count fields

Trait Implementations§

source§

impl ViewElement3D for Grid3D

source§

fn get_transform(&self) -> Transform3D

This should return the object’s transform
source§

fn get_vertices(&self) -> &[Vec3D]

This should return all of the object’s vertices
source§

fn get_faces(&self) -> &[Face]

This should return all of the object’s Faces

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.