pub enum Orientation2D {
Above,
Right,
Below,
Left,
}Expand description
Orientation of two 2D items.
Variants§
Above
Point is above the origin.
Right
Point is to the right of the origin.
Below
Point is below the origin.
Left
Point is to the left of the origin.
Implementations§
Source§impl Orientation2D
impl Orientation2D
Sourcepub fn point_is(self, origin: Point2D<Px, Px>, point: Point2D<Px, Px>) -> bool
pub fn point_is(self, origin: Point2D<Px, Px>, point: Point2D<Px, Px>) -> bool
Check if point is orientation from origin.
Returns true if the point is hit by a 45º frustum cast from origin in the direction defined by the orientation.
Sourcepub fn box_is(self, origin: Box2D<Px, Px>, b: Box2D<Px, Px>) -> bool
pub fn box_is(self, origin: Box2D<Px, Px>, b: Box2D<Px, Px>) -> bool
Check if b is orientation from origin.
Returns true if the box b collides with the box origin in the direction defined by orientation. Also
returns true if the boxes already overlap.
Sourcepub fn search_bounds(
self,
origin: Point2D<Px, Px>,
max_distance: Px,
spatial_bounds: Box2D<Px, Px>,
) -> impl Iterator<Item = Box2D<Px, Px>> + 'static
pub fn search_bounds( self, origin: Point2D<Px, Px>, max_distance: Px, spatial_bounds: Box2D<Px, Px>, ) -> impl Iterator<Item = Box2D<Px, Px>> + 'static
Iterator that yields quadrants for efficient search in a quad-tree, if a point is inside a quadrant and
passes the Orientation2D::point_is check it is in the orientation, them if it is within the max_distance it is valid.
Trait Implementations§
Source§impl Clone for Orientation2D
impl Clone for Orientation2D
Source§fn clone(&self) -> Orientation2D
fn clone(&self) -> Orientation2D
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Orientation2D
impl Debug for Orientation2D
Source§impl<'de> Deserialize<'de> for Orientation2D
impl<'de> Deserialize<'de> for Orientation2D
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Orientation2D, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Orientation2D, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl IntoVar<Option<Orientation2D>> for Orientation2D
impl IntoVar<Option<Orientation2D>> for Orientation2D
Source§impl PartialEq for Orientation2D
impl PartialEq for Orientation2D
Source§impl Serialize for Orientation2D
impl Serialize for Orientation2D
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for Orientation2D
impl Eq for Orientation2D
impl IntoValue<Option<Orientation2D>> for Orientation2D
impl StructuralPartialEq for Orientation2D
Auto Trait Implementations§
impl Freeze for Orientation2D
impl RefUnwindSafe for Orientation2D
impl Send for Orientation2D
impl Sync for Orientation2D
impl Unpin for Orientation2D
impl UnwindSafe for Orientation2D
Blanket Implementations§
Source§impl<T> AnyVarValue for T
impl<T> AnyVarValue for T
Source§fn clone_boxed(&self) -> BoxAnyVarValue
fn clone_boxed(&self) -> BoxAnyVarValue
Clone the value.
Source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
Gets if
self and other are equal.Source§fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
Swap value with
other if both are of the same type.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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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