[−][src]Struct kas::geom::Quad
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: Vec2
b: Vec2
Implementations
impl Quad
[src]
pub fn with_coords(a: Vec2, b: Vec2) -> Self
[src]
Construct with two coords
pub fn with_pos_and_size(pos: Vec2, size: Vec2) -> Self
[src]
Construct with position and size
pub fn size(&self) -> Vec2
[src]
Get the size
pub fn ab(&self) -> Vec2
[src]
Swizzle coordinates: x from first, y from second point
pub fn ba(&self) -> Vec2
[src]
Swizzle coordinates: x from second, y from first point
pub fn shrink(&self, value: f32) -> Quad
[src]
Shrink self in all directions by the given value
In debug mode, this asserts a.le(b)
after shrinking.
pub fn shrink_vec(&self, value: Vec2) -> Quad
[src]
Shrink self in all directions by the given value
In debug mode, this asserts a.le(b)
after shrinking.
pub fn intersection(&self, rhs: &Quad) -> Option<Quad>
[src]
Calculate the intersection of two quads
Trait Implementations
impl Clone for Quad
[src]
impl Copy for Quad
[src]
impl Debug for Quad
[src]
impl From<Rect> for Quad
[src]
impl PartialEq<Quad> for Quad
[src]
impl StructuralPartialEq for Quad
[src]
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
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,
pub 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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,