pub struct Transformed2d<'a, F: Float, T: Transform2d<F> + ?Sized> {
    pub inner: &'a T,
    pub transform: mat3<F>,
}
Expand description

A reference to a 2d object with additional transformation applied

Fields§

§inner: &'a T

Reference to the actual object

§transform: mat3<F>

Additional transformation

Implementations§

source§

impl<'a, F: Float, T: Transform2d<F> + ?Sized> Transformed2d<'a, F, T>

source

pub fn new(inner: &'a T, transform: mat3<F>) -> Self

Apply additional transformation to the given object

Trait Implementations§

source§

impl<'a, F: Float, T: Transform2d<F> + ?Sized> Transform2d<F> for Transformed2d<'a, F, T>

source§

fn bounding_quad(&self) -> Quad<F>

Object’s bounding Quad
source§

fn apply_transform(&mut self, transform: mat3<F>)

Apply transformation matrix to this object

Auto Trait Implementations§

§

impl<'a, F, T: ?Sized> RefUnwindSafe for Transformed2d<'a, F, T>

§

impl<'a, F, T: ?Sized> Send for Transformed2d<'a, F, T>
where F: Send, T: Sync,

§

impl<'a, F, T: ?Sized> Sync for Transformed2d<'a, F, T>
where F: Sync, T: Sync,

§

impl<'a, F, T: ?Sized> Unpin for Transformed2d<'a, F, T>
where F: Unpin,

§

impl<'a, F, T: ?Sized> UnwindSafe for Transformed2d<'a, F, T>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<F, T> Transform2dExt<F> for T
where F: Float, T: Transform2d<F> + ?Sized,

source§

fn transform(self, transform: mat3<F>) -> Self
where Self: Sized,

Apply transformation to the object, returning a modified value to allow chaining methods
source§

fn align_bounding_box(self, alignment: vec2<F>) -> Self
where Self: Sized,

Align bounding box of this object, making its origin located at (0, 0) Read more
source§

fn rotate(self, angle: Angle<F>) -> Self
where Self: Sized,

Rotate object around (0, 0) by given angle
source§

fn translate(self, delta: vec2<F>) -> Self
where Self: Sized,

Translate object by given vector
source§

fn scale(self, factor: vec2<F>) -> Self
where Self: Sized,

Scale object around (0, 0) by given factor
source§

fn scale_uniform(self, factor: F) -> Self
where Self: Sized,

Scale object around (0, 0) by given factor uniformly along both axis
source§

fn transformed(&self) -> Transformed2d<'_, F, Self>

Create a reference to this object with additional transformation applied
source§

fn bounding_box(&self) -> Aabb2<F>

Calculate bounding box of this object, getting Aabb2 instead of a Quad
source§

fn fit_into(self, target: impl FitTarget2d<F>) -> Self
where Self: Sized,

Make this object’s bounding Quad fit into given target
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V