Skip to main content

OrthoTransform

Trait OrthoTransform 

Source
pub trait OrthoTransform: Sized {
    // Required methods
    fn x_flipped(self) -> Self;
    fn rotated(self, amount: i8) -> Self;

    // Provided methods
    fn y_flipped(self) -> Self { ... }
    fn transformed(self, amount: OrthoTransformation) -> Self { ... }
}
Expand description

Trait for objects that can perform a 2D orthogonal transformation. In other words, they can be flipped along the x and y axis, and they can be rotated by multiples of 90 degrees.

Required Methods§

Source

fn x_flipped(self) -> Self

Flip the object parallel to the x axis, so x becomes -x.

Source

fn rotated(self, amount: i8) -> Self

Rotate the object counter-clockwise by the given amount.

Provided Methods§

Source

fn y_flipped(self) -> Self

Flip the object parallel to the y axis, so y becomes -y.

Source

fn transformed(self, amount: OrthoTransformation) -> Self

Transform the object by the given amount.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§