Struct sark_grids::pivot::PivotedPoint
source · [−]Expand description
A 2d point on a rect aligned to a certain Pivot.
Fields
point: IVec2
pivot: Pivot
Implementations
sourceimpl PivotedPoint
impl PivotedPoint
sourcepub fn pivot_point(&self) -> IVec2
pub fn pivot_point(&self) -> IVec2
Returns the point from the perspective of the pivot.
Trait Implementations
sourceimpl Clone for PivotedPoint
impl Clone for PivotedPoint
sourcefn clone(&self) -> PivotedPoint
fn clone(&self) -> PivotedPoint
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl GridPoint for PivotedPoint
impl GridPoint for PivotedPoint
fn x(&self) -> i32
fn y(&self) -> i32
fn as_ivec2(&self) -> IVec2
fn as_uvec2(&self) -> UVec2
fn as_vec2(&self) -> Vec2
fn to_array(&self) -> [i32; 2]
sourcefn pivot(&self, pivot: Pivot) -> PivotedPoint
fn pivot(&self, pivot: Pivot) -> PivotedPoint
Return a PivotedPoint.
sourcefn up_by(&self, amount: i32) -> IVec2
fn up_by(&self, amount: i32) -> IVec2
Returns the grid point the given number of spaces above this one.
sourcefn down_by(&self, amount: i32) -> IVec2
fn down_by(&self, amount: i32) -> IVec2
Returns the grid point the given number of spaces below this one.
sourcefn right_by(&self, amount: i32) -> IVec2
fn right_by(&self, amount: i32) -> IVec2
Returns the grid point the given number of spaces to the right of this one.
sourcefn left_by(&self, amount: i32) -> IVec2
fn left_by(&self, amount: i32) -> IVec2
Returns the grid point the given number of spaces to the left of this one.
sourcefn taxi_dist(self, other: impl GridPoint) -> usize
fn taxi_dist(self, other: impl GridPoint) -> usize
The taxicab distance between two grid points.
impl Copy for PivotedPoint
Auto Trait Implementations
impl RefUnwindSafe for PivotedPoint
impl Send for PivotedPoint
impl Sync for PivotedPoint
impl Unpin for PivotedPoint
impl UnwindSafe for PivotedPoint
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more