Struct gaia_quadtree::Tile
[−]
[src]
pub struct Tile { pub offset: i16, pub level: u8, pub x: u8, pub y: u8, }
Fields
offset: i16
level: u8
x: u8
y: u8
Methods
impl Tile
[src]
fn new_at_origin(level: u8, x: u8, y: u8) -> Tile
[src]
fn enclosing_point(level: u8, position: [f32; 2]) -> Tile
[src]
fn parent(&self) -> Option<Tile>
[src]
fn position_in_parent(&self) -> Option<PositionInParent>
[src]
fn width(&self) -> f32
[src]
fn top_left_position(&self) -> [f32; 2]
[src]
fn bottom_right_position(&self) -> [f32; 2]
[src]
fn level_width(level: u8) -> f32
[src]
The width of tiles at level level
.
fn tiles_across_width(level: u8) -> u8
[src]
fn tiles_across_height(level: u8) -> u8
[src]
fn offset_by(&self, x: i16, y: i16) -> Tile
[src]
Get this tile's neighbor that is x
tiles to the left/right and y
tiles to the
top/bottom.
The y-axis values will be clamped according to the number of tiles along the vertical axis.
The x-axis values will wrap, incrementing or decrementing the offset
depending on the
direction of the wrap.
Trait Implementations
impl PartialEq for Tile
[src]
fn eq(&self, __arg_0: &Tile) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Tile) -> bool
[src]
This method tests for !=
.