pub struct Mat {
pub x: Vect,
pub y: Vect,
pub c: Vect,
}
Expand description
mat is 3 x 3 matrix used for 2D transformations. Simples explanation i can coe up with:
3x3 matrix is vector trio where x is vector describing x axis and y is describing y axis
c is determining where these two axises intersect. Matrix is something like a custom coordinate
system. To convert point from classic coordinate system to matrix coordinates you use prj
method. Don’t worry though if you do not understand. Matrix in this package is just optional
interface you may or may not use. All it does are slightly more complex transformations.
Fields§
§x: Vect
§y: Vect
§c: Vect
Implementations§
Source§impl Mat
impl Mat
pub const IM: Mat
pub const ZM: Mat
pub fn new(pos: Vect, scl: Vect, rot: f32) -> Mat
Sourcepub fn to_glm_mat4(&self) -> Mat4
pub fn to_glm_mat4(&self) -> Mat4
to_glm_mat4 turns Mat to glm::Mat4 for internal purposes
Sourcepub fn scaled_xy(self, around: Vect, scl: Vect) -> Mat
pub fn scaled_xy(self, around: Vect, scl: Vect) -> Mat
returns matrix scaled by Vector around Vector
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Mat
impl RefUnwindSafe for Mat
impl Send for Mat
impl Sync for Mat
impl Unpin for Mat
impl UnwindSafe for Mat
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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more