pub struct Point(pub f32, pub f32);
Expand description
A Point in 2D space with x and y coordinates
Tuple Fields§
§0: f32
§1: f32
Implementations§
Trait Implementations§
Source§impl AlmostCollidesWith<Point> for Rect
impl AlmostCollidesWith<Point> for Rect
fn almost_collides_with(&self, point: &Point) -> bool
Source§impl CollidesWith<Point> for Circle
impl CollidesWith<Point> for Circle
fn collides_with(&self, point: &Point) -> bool
Source§impl CollidesWith<Point> for Rect
impl CollidesWith<Point> for Rect
fn collides_with(&self, point: &Point) -> bool
Source§impl CollidesWith<Point> for SPolygon
impl CollidesWith<Point> for SPolygon
fn collides_with(&self, point: &Point) -> bool
Source§impl<T> CollidesWith<T> for Pointwhere
T: CollidesWith<Point>,
impl<T> CollidesWith<T> for Pointwhere
T: CollidesWith<Point>,
fn collides_with(&self, other: &T) -> bool
Source§impl DistanceTo<Point> for Circle
impl DistanceTo<Point> for Circle
Source§fn distance_to(&self, point: &Point) -> f32
fn distance_to(&self, point: &Point) -> f32
Minimum distance between two primitives. Will be 0 in case of a collision.
Source§fn sq_distance_to(&self, other: &Point) -> f32
fn sq_distance_to(&self, other: &Point) -> f32
Squared version of DistanceTo::distance_to
Source§impl DistanceTo<Point> for Edge
impl DistanceTo<Point> for Edge
Source§fn distance_to(&self, point: &Point) -> f32
fn distance_to(&self, point: &Point) -> f32
Minimum distance between two primitives. Will be 0 in case of a collision.
Source§fn sq_distance_to(&self, point: &Point) -> f32
fn sq_distance_to(&self, point: &Point) -> f32
Squared version of DistanceTo::distance_to
Source§impl DistanceTo<Point> for Point
impl DistanceTo<Point> for Point
Source§fn distance_to(&self, other: &Point) -> f32
fn distance_to(&self, other: &Point) -> f32
Minimum distance between two primitives. Will be 0 in case of a collision.
Source§fn sq_distance_to(&self, other: &Point) -> f32
fn sq_distance_to(&self, other: &Point) -> f32
Squared version of DistanceTo::distance_to
Source§impl DistanceTo<Point> for Rect
impl DistanceTo<Point> for Rect
Source§fn distance_to(&self, point: &Point) -> f32
fn distance_to(&self, point: &Point) -> f32
Minimum distance between two primitives. Will be 0 in case of a collision.
Source§fn sq_distance_to(&self, point: &Point) -> f32
fn sq_distance_to(&self, point: &Point) -> f32
Squared version of DistanceTo::distance_to
Source§impl DistanceTo<Point> for SPolygon
impl DistanceTo<Point> for SPolygon
Source§fn distance_to(&self, point: &Point) -> f32
fn distance_to(&self, point: &Point) -> f32
Minimum distance between two primitives. Will be 0 in case of a collision.
Source§fn sq_distance_to(&self, point: &Point) -> f32
fn sq_distance_to(&self, point: &Point) -> f32
Squared version of DistanceTo::distance_to
Source§impl SeparationDistance<Point> for Circle
impl SeparationDistance<Point> for Circle
Source§fn separation_distance(&self, point: &Point) -> (GeoPosition, f32)
fn separation_distance(&self, point: &Point) -> (GeoPosition, f32)
In case of a collision between
self
and other
, returns GeoPosition::Interior and the minimum distance to separate the two primitives.
Otherwise, returns GeoPosition::Exterior and the minimum distance between the two primitives. (similar to DistanceTo::distance_to)Source§fn sq_separation_distance(&self, point: &Point) -> (GeoPosition, f32)
fn sq_separation_distance(&self, point: &Point) -> (GeoPosition, f32)
Squared version of SeparationDistance::separation_distance
Source§impl SeparationDistance<Point> for Rect
impl SeparationDistance<Point> for Rect
Source§fn separation_distance(&self, point: &Point) -> (GeoPosition, f32)
fn separation_distance(&self, point: &Point) -> (GeoPosition, f32)
In case of a collision between
self
and other
, returns GeoPosition::Interior and the minimum distance to separate the two primitives.
Otherwise, returns GeoPosition::Exterior and the minimum distance between the two primitives. (similar to DistanceTo::distance_to)Source§fn sq_separation_distance(&self, point: &Point) -> (GeoPosition, f32)
fn sq_separation_distance(&self, point: &Point) -> (GeoPosition, f32)
Squared version of SeparationDistance::separation_distance
Source§impl SeparationDistance<Point> for SPolygon
impl SeparationDistance<Point> for SPolygon
Source§fn separation_distance(&self, point: &Point) -> (GeoPosition, f32)
fn separation_distance(&self, point: &Point) -> (GeoPosition, f32)
In case of a collision between
self
and other
, returns GeoPosition::Interior and the minimum distance to separate the two primitives.
Otherwise, returns GeoPosition::Exterior and the minimum distance between the two primitives. (similar to DistanceTo::distance_to)Source§fn sq_separation_distance(&self, point: &Point) -> (GeoPosition, f32)
fn sq_separation_distance(&self, point: &Point) -> (GeoPosition, f32)
Squared version of SeparationDistance::separation_distance
Source§impl Transformable for Point
impl Transformable for Point
Source§fn transform(&mut self, t: &Transformation) -> &mut Self
fn transform(&mut self, t: &Transformation) -> &mut Self
Applies a transformation to
self
.Source§fn transform_clone(&self, t: &Transformation) -> Self
fn transform_clone(&self, t: &Transformation) -> Self
Applies a transformation to a clone.
Source§impl TransformableFrom for Point
impl TransformableFrom for Point
Source§fn transform_from(&mut self, reference: &Self, t: &Transformation) -> &mut Self
fn transform_from(&mut self, reference: &Self, t: &Transformation) -> &mut Self
Applies a transformation on the reference object and stores the result in
self
.impl Copy for Point
impl Eq for Point
impl StructuralPartialEq for Point
Auto Trait Implementations§
impl Freeze for Point
impl RefUnwindSafe for Point
impl Send for Point
impl Sync for Point
impl Unpin for Point
impl UnwindSafe for Point
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more