pub struct Trans {
pub rot: Rot4,
pub mirror: bool,
pub disp: Vec2,
}Expand description
Exact orthogonal transform: optional mirror about X axis, then rotation, then translation. Composition is exact; coordinates stay on grid.
Fields§
§rot: Rot4§mirror: bool§disp: Vec2Implementations§
Source§impl Trans
impl Trans
pub const IDENTITY: Self
pub const fn new(rot: Rot4, mirror: bool, disp: Vec2) -> Self
pub fn translate(disp: Vec2) -> Self
pub fn rotate(rot: Rot4) -> Self
pub fn mirror_x() -> Self
pub fn apply(self, p: Point) -> Point
pub fn apply_bbox(self, b: Bbox) -> Bbox
Sourcepub fn compose(self, other: Trans) -> Trans
pub fn compose(self, other: Trans) -> Trans
Composition: (self * other).apply(p) == self.apply(other.apply(p)).
pub fn inverse(self) -> Trans
Trait Implementations§
impl Copy for Trans
impl Eq for Trans
impl StructuralPartialEq for Trans
Auto Trait Implementations§
impl Freeze for Trans
impl RefUnwindSafe for Trans
impl Send for Trans
impl Sync for Trans
impl Unpin for Trans
impl UnsafeUnpin for Trans
impl UnwindSafe for Trans
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