[−][src]Struct rustbatch::math::mat::Mat
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
impl Mat
[src]
pub const IM: Mat
[src]
pub const ZM: Mat
[src]
pub fn new(pos: Vect, scl: Vect, rot: f32) -> Mat
[src]
pub fn to_glm_mat4(&self) -> Mat4
[src]
to_glm_mat4 turns Mat to glm::Mat4 for internal purposes
pub fn moved(self, delta: Vect) -> Mat
[src]
returns moved matrix.
pub fn sxy(&mut self, scl: Vect)
[src]
scales matrix by vector
pub fn scaled_xy(self, around: Vect, scl: Vect) -> Mat
[src]
returns matrix scaled by Vector around Vector
pub fn scaled(self, around: Vect, scl: f32) -> Mat
[src]
same as scaled_xy but scaling is homogenous
pub fn rotated(self, around: Vect, ang: f32) -> Mat
[src]
returns matrix rotated by angle around a point.
pub fn prj(&self, u: Vect) -> Vect
[src]
prj projects point by matrix
pub fn unprj(&self, u: Vect) -> Vect
[src]
opposite of prj
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Mat
impl Send for Mat
impl Sync for Mat
impl Unpin for Mat
impl UnwindSafe for Mat
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,