Struct sark_grids::world_grid::WorldGrid [−][src]
pub struct WorldGrid {
pub world_pos: Vec2,
// some fields omitted
}
Expand description
A sized grid with a custom pivot for translating between aligned grid points and world space.
Fields
world_pos: Vec2
Implementations
Create a grid with it’s world position set to origin.
Returns the tile position of a given tile.
A tile’s “position” refers to the bottom left point on the tile.
Returns the position of the given tile in world space.
A tile’s “position” refers to the bottom left point on the tile.
Return’s the center of the given tile in world space.
Whether or not the given grid position is inside the grid bounds.
A grid’s bounds are determined by it’s pivot - a grid’s pivot always sits on the world origin.
Whether or not the given 2d index is inside the grid bounds.
Convert a grid point to it’s corresponding 2d index.
Returns none if the given grid point is out of bounds.
Converts from a local grid position to it’s corresponding 2d index.
This function will return invalid values if given out of bounds grid positions.
For a bound-checked version use try_grid_to_index_2d
Convert from a 2d index to it’s corresponding grid position.
An iterator over the tile position of every tile in the grid.
A tile’s “position” refers to the bottom left point on the tile.
An iterator over the tile center of every tile in the grid.
An iterator over the tile position of every tile in the grid.
A tile’s “position” refers to the bottom left point on the tile.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for WorldGrid
impl UnwindSafe for WorldGrid
Blanket Implementations
Mutably borrows from an owned value. Read more