Trait geng::prelude::lapp::Transform2dExt
pub trait Transform2dExt<F>: Transform2d<F>where
F: Float,{
// Provided methods
fn transform(self, transform: mat3<F>) -> Self
where Self: Sized { ... }
fn align_bounding_box(self, alignment: vec2<F>) -> Self
where Self: Sized { ... }
fn rotate(self, angle: Angle<F>) -> Self
where Self: Sized { ... }
fn translate(self, delta: vec2<F>) -> Self
where Self: Sized { ... }
fn scale(self, factor: vec2<F>) -> Self
where Self: Sized { ... }
fn scale_uniform(self, factor: F) -> Self
where Self: Sized { ... }
fn transformed(&self) -> Transformed2d<'_, F, Self> { ... }
fn bounding_box(&self) -> Aabb2<F> { ... }
fn fit_into(self, target: impl FitTarget2d<F>) -> Self
where Self: Sized { ... }
}
Expand description
Extra methods for Transform2d types
Provided Methods§
fn transform(self, transform: mat3<F>) -> Selfwhere
Self: Sized,
fn transform(self, transform: mat3<F>) -> Selfwhere
Self: Sized,
Apply transformation to the object, returning a modified value to allow chaining methods
fn align_bounding_box(self, alignment: vec2<F>) -> Selfwhere
Self: Sized,
fn align_bounding_box(self, alignment: vec2<F>) -> Selfwhere
Self: Sized,
Align bounding box of this object, making its origin located at (0, 0)
§Examples
let quad = Quad::unit();
assert_eq!(quad.bounding_box(), Aabb2::from_corners(vec2(-1.0, -1.0), vec2(1.0, 1.0)));
let quad = quad.align_bounding_box(vec2(0.0, 1.0));
assert_eq!(quad.bounding_box(), Aabb2::from_corners(vec2(0.0, 0.0), vec2(2.0, -2.0)));
fn rotate(self, angle: Angle<F>) -> Selfwhere
Self: Sized,
fn rotate(self, angle: Angle<F>) -> Selfwhere
Self: Sized,
Rotate object around (0, 0) by given angle
fn scale_uniform(self, factor: F) -> Selfwhere
Self: Sized,
fn scale_uniform(self, factor: F) -> Selfwhere
Self: Sized,
Scale object around (0, 0) by given factor uniformly along both axis
fn transformed(&self) -> Transformed2d<'_, F, Self>
fn transformed(&self) -> Transformed2d<'_, F, Self>
Create a reference to this object with additional transformation applied
fn bounding_box(&self) -> Aabb2<F>
fn bounding_box(&self) -> Aabb2<F>
fn fit_into(self, target: impl FitTarget2d<F>) -> Selfwhere
Self: Sized,
fn fit_into(self, target: impl FitTarget2d<F>) -> Selfwhere
Self: Sized,
Make this object’s bounding Quad fit into given target
Object Safety§
This trait is not object safe.