[−]Struct rltk::Point
Helper struct defining a 2D point in space.
Fields
x: i32
y: i32
Methods
impl Point
#[must_use]pub fn new<T>(x: T, y: T) -> Point where
T: TryInto<i32>,
T: TryInto<i32>,
Create a new point from an x/y coordinate.
pub const fn constant(x: i32, y: i32) -> Point
Create a new point from i32, this can be constant
pub fn zero() -> Point
pub fn from_tuple<T>(t: (T, T)) -> Point where
T: TryInto<i32>,
T: TryInto<i32>,
pub fn to_index<T>(self, width: T) -> usize where
T: TryInto<usize>,
T: TryInto<usize>,
Helper for map index conversion
pub fn to_tuple(self) -> (i32, i32)
Converts the point to an i32 tuple
pub fn to_unsigned_tuple(self) -> (usize, usize)
Converts the point to a usize tuple
pub fn to_vec2(self) -> Vec2
Converts the point to an UltraViolet vec2
pub fn to_vec2i(self) -> Vec2i
Converts the point to an UltraViolet vec2i
pub fn from_vec2(v: Vec2) -> Point
Creates a point from an UltraViolet vec2
pub fn from_vec2i(v: Vec2i) -> Point
Creates a point from an UltraViolet vec2i
Trait Implementations
impl Add<Point> for Point
Overloads: We support basic point math Support adding a point to a point
type Output = Point
The resulting type after applying the +
operator.
fn add(self, rhs: Point) -> Point
impl Add<i32> for Point
Support adding an int to a point
type Output = Point
The resulting type after applying the +
operator.
fn add(self, rhs: i32) -> Point
impl Clone for Point
fn clone(&self) -> Point
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for Point
impl Debug for Point
impl Div<Point> for Point
Support dividing a point by a point
type Output = Point
The resulting type after applying the /
operator.
fn div(self, rhs: Point) -> Point
impl Div<f32> for Point
Support dividing a point by an f32
type Output = Point
The resulting type after applying the /
operator.
fn div(self, rhs: f32) -> Point
impl Div<i32> for Point
Support dividing a point by an int
type Output = Point
The resulting type after applying the /
operator.
fn div(self, rhs: i32) -> Point
impl Eq for Point
impl From<(f32, f32)> for Point
impl From<(i32, i32)> for Point
impl From<Vec2> for Point
impl From<Vec2i> for Point
impl Hash for Point
fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
__H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Mul<Point> for Point
Support multiplying a point by a point
type Output = Point
The resulting type after applying the *
operator.
fn mul(self, rhs: Point) -> Point
impl Mul<f32> for Point
Support multiplying a point by an f32
type Output = Point
The resulting type after applying the *
operator.
fn mul(self, rhs: f32) -> Point
impl Mul<i32> for Point
Support multiplying a point by an int
type Output = Point
The resulting type after applying the *
operator.
fn mul(self, rhs: i32) -> Point
impl PartialEq<Point> for Point
impl StructuralEq for Point
impl StructuralPartialEq for Point
impl Sub<Point> for Point
Support subtracting a point from a point
type Output = Point
The resulting type after applying the -
operator.
fn sub(self, rhs: Point) -> Point
impl Sub<i32> for Point
Support subtracting an int from a point
Auto Trait Implementations
impl RefUnwindSafe for Point
impl Send for Point
impl Sync for Point
impl Unpin for Point
impl UnwindSafe for Point
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,