Expand description
Axis-aligned 2D cuboid, specified via two corners a and b
Typically it is expected that a.le(b), although this is not required.
Fields
a: Vec2b: Vec2Implementations
sourceimpl Quad
impl Quad
sourcepub const fn from_coords(a: Vec2, b: Vec2) -> Self
pub const fn from_coords(a: Vec2, b: Vec2) -> Self
Construct with two coords
sourcepub fn from_pos_and_size(pos: Vec2, size: Vec2) -> Self
pub fn from_pos_and_size(pos: Vec2, size: Vec2) -> Self
Construct with position and size
sourcepub fn shrink_vec(&self, value: Vec2) -> Quad
pub fn shrink_vec(&self, value: Vec2) -> Quad
Shrink self in all directions by the given value
sourcepub fn intersection(&self, rhs: &Quad) -> Option<Quad>
pub fn intersection(&self, rhs: &Quad) -> Option<Quad>
Calculate the intersection of two quads
Trait Implementations
sourceimpl AddAssign<Vec2> for Quad
impl AddAssign<Vec2> for Quad
sourcefn add_assign(&mut self, rhs: Vec2)
fn add_assign(&mut self, rhs: Vec2)
Performs the += operation. Read more
sourceimpl<'de> Deserialize<'de> for Quad
impl<'de> Deserialize<'de> for Quad
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl PartialEq<Quad> for Quad
impl PartialEq<Quad> for Quad
sourceimpl SubAssign<Vec2> for Quad
impl SubAssign<Vec2> for Quad
sourcefn sub_assign(&mut self, rhs: Vec2)
fn sub_assign(&mut self, rhs: Vec2)
Performs the -= operation. Read more
impl Copy for Quad
impl StructuralPartialEq for Quad
Auto Trait Implementations
impl RefUnwindSafe for Quad
impl Send for Quad
impl Sync for Quad
impl Unpin for Quad
impl UnwindSafe for Quad
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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
sourceimpl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
sourcefn try_cast_approx(self) -> Result<T, Error>
fn try_cast_approx(self) -> Result<T, Error>
Try approximate conversion from Self to T Read more
sourcefn cast_approx(self) -> T
fn cast_approx(self) -> T
Cast approximately from Self to T Read more
sourceimpl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
sourcefn cast_trunc(self) -> T
fn cast_trunc(self) -> T
Cast to integer, truncating Read more
sourcefn cast_nearest(self) -> T
fn cast_nearest(self) -> T
Cast to the nearest integer Read more
sourcefn cast_floor(self) -> T
fn cast_floor(self) -> T
Cast the floor to an integer Read more
sourcefn try_cast_trunc(self) -> Result<T, Error>
fn try_cast_trunc(self) -> Result<T, Error>
Try converting to integer with truncation Read more
sourcefn try_cast_nearest(self) -> Result<T, Error>
fn try_cast_nearest(self) -> Result<T, Error>
Try converting to the nearest integer Read more
sourcefn try_cast_floor(self) -> Result<T, Error>
fn try_cast_floor(self) -> Result<T, Error>
Try converting the floor to an integer Read more
sourcefn try_cast_ceil(self) -> Result<T, Error>
fn try_cast_ceil(self) -> Result<T, Error>
Try convert the ceiling to an integer Read more
sourceimpl<S, T> ConvApprox<S> for Twhere
T: Conv<S>,
impl<S, T> ConvApprox<S> for Twhere
T: Conv<S>,
sourcefn try_conv_approx(x: S) -> Result<T, Error>
fn try_conv_approx(x: S) -> Result<T, Error>
Try converting from T to Self, allowing approximation of value Read more
sourcefn conv_approx(x: S) -> T
fn conv_approx(x: S) -> T
Converting from T to Self, allowing approximation of value Read more