Struct raqote::draw_target::fk::Transform2F
source · pub struct Transform2F {
pub matrix: Matrix2x2F,
pub vector: Vector2F,
}
Expand description
An affine transform, optimized with SIMD.
Fields§
§matrix: Matrix2x2F
§vector: Vector2F
Implementations§
source§impl Transform2F
impl Transform2F
pub fn from_scale<S>(scale: S) -> Transform2Fwhere
S: IntoVector2F,
pub fn from_rotation(theta: f32) -> Transform2F
pub fn from_rotation_vector(vector: UnitVector) -> Transform2F
pub fn from_translation(vector: Vector2F) -> Transform2F
pub fn from_scale_rotation_translation<S>(
scale: S,
theta: f32,
translation: Vector2F,
) -> Transform2Fwhere
S: IntoVector2F,
pub fn row_major( m11: f32, m12: f32, m21: f32, m22: f32, m31: f32, m32: f32, ) -> Transform2F
pub fn to_3d(&self) -> Transform4F
pub fn is_identity(&self) -> bool
sourcepub fn extract_scale(&self) -> Vector2F
pub fn extract_scale(&self) -> Vector2F
Extracts the scale from this matrix.
pub fn m11(&self) -> f32
pub fn m21(&self) -> f32
pub fn m12(&self) -> f32
pub fn m22(&self) -> f32
pub fn m31(&self) -> f32
pub fn m32(&self) -> f32
pub fn translate(&self, vector: Vector2F) -> Transform2F
pub fn rotate(&self, theta: f32) -> Transform2F
pub fn scale<S>(&self, scale: S) -> Transform2Fwhere
S: IntoVector2F,
sourcepub fn translation(&self) -> Vector2F
pub fn translation(&self) -> Vector2F
Returns the translation part of this matrix.
This decomposition assumes that scale, rotation, and translation are applied in that order.
sourcepub fn rotation(&self) -> f32
pub fn rotation(&self) -> f32
Returns the rotation angle of this matrix.
This decomposition assumes that scale, rotation, and translation are applied in that order.
sourcepub fn scale_factor(&self) -> f32
pub fn scale_factor(&self) -> f32
Returns the scale factor of this matrix.
This decomposition assumes that scale, rotation, and translation are applied in that order.
pub fn inverse(&self) -> Transform2F
Trait Implementations§
source§impl Clone for Transform2F
impl Clone for Transform2F
source§fn clone(&self) -> Transform2F
fn clone(&self) -> Transform2F
Returns a copy 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 Transform2F
impl Debug for Transform2F
source§impl Default for Transform2F
impl Default for Transform2F
source§fn default() -> Transform2F
fn default() -> Transform2F
Returns the “default value” for a type. Read more
source§impl Mul<LineSegment2F> for Transform2F
impl Mul<LineSegment2F> for Transform2F
source§type Output = LineSegment2F
type Output = LineSegment2F
The resulting type after applying the
*
operator.source§fn mul(self, line_segment: LineSegment2F) -> LineSegment2F
fn mul(self, line_segment: LineSegment2F) -> LineSegment2F
Performs the
*
operation. Read moresource§impl Mul<RectF> for Transform2F
impl Mul<RectF> for Transform2F
source§impl Mul<Vector2F> for Transform2F
impl Mul<Vector2F> for Transform2F
source§impl Mul for Transform2F
impl Mul for Transform2F
source§type Output = Transform2F
type Output = Transform2F
The resulting type after applying the
*
operator.source§fn mul(self, other: Transform2F) -> Transform2F
fn mul(self, other: Transform2F) -> Transform2F
Performs the
*
operation. Read moresource§impl MulAssign for Transform2F
impl MulAssign for Transform2F
source§fn mul_assign(&mut self, other: Transform2F)
fn mul_assign(&mut self, other: Transform2F)
Performs the
*=
operation. Read moresource§impl PartialEq for Transform2F
impl PartialEq for Transform2F
impl Copy for Transform2F
impl StructuralPartialEq for Transform2F
Auto Trait Implementations§
impl Freeze for Transform2F
impl RefUnwindSafe for Transform2F
impl Send for Transform2F
impl Sync for Transform2F
impl Unpin for Transform2F
impl UnwindSafe for Transform2F
Blanket Implementations§
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)