pub trait Matrix<T>where
T: Copy,{
// Required methods
fn set<M>(&mut self, other: M) -> &mut Self
where [[T; 4]; 4]: From<M>;
fn translate<V>(&mut self, translation_vector: V) -> &mut Self
where V: Vector<T>;
fn scale<V>(&mut self, scaling_vector: V) -> &mut Self
where V: Vector<T>;
fn scale_at<P, V>(&mut self, position: P, scaling_vector: V) -> &mut Self
where P: Vector<T>,
V: Vector<T>;
fn rotate(&mut self, radians: T) -> &mut Self;
fn rotate_at<P>(&mut self, position: P, radians: T) -> &mut Self
where P: Vector<T>;
fn rotate_axis<V>(&mut self, radians: T, axis: V) -> &mut Self
where Vec3<T>: From<V>;
fn rotate_axis_at<P, V>(
&mut self,
position: P,
radians: T,
axis: V,
) -> &mut Self
where P: Vector<T>,
Vec3<T>: From<V>;
fn get_rotation(&self) -> Self;
fn get_translation(&self) -> Vec3<T>;
fn get_scale(&self) -> Vec3<T>;
fn get_euler(&self) -> Vec3<T>;
}Expand description
Matrix-methods for 4x4 arrays.
Required Methods§
Sourcefn translate<V>(&mut self, translation_vector: V) -> &mut Selfwhere
V: Vector<T>,
fn translate<V>(&mut self, translation_vector: V) -> &mut Selfwhere
V: Vector<T>,
Translate matrix by given vector.
Sourcefn scale<V>(&mut self, scaling_vector: V) -> &mut Selfwhere
V: Vector<T>,
fn scale<V>(&mut self, scaling_vector: V) -> &mut Selfwhere
V: Vector<T>,
Scale matrix by given vector.
Sourcefn scale_at<P, V>(&mut self, position: P, scaling_vector: V) -> &mut Self
fn scale_at<P, V>(&mut self, position: P, scaling_vector: V) -> &mut Self
Scales at given position.
Sourcefn rotate_at<P>(&mut self, position: P, radians: T) -> &mut Selfwhere
P: Vector<T>,
fn rotate_at<P>(&mut self, position: P, radians: T) -> &mut Selfwhere
P: Vector<T>,
Rotates around z at given position.
Sourcefn rotate_axis<V>(&mut self, radians: T, axis: V) -> &mut Self
fn rotate_axis<V>(&mut self, radians: T, axis: V) -> &mut Self
Rotates around axis.
Sourcefn rotate_axis_at<P, V>(
&mut self,
position: P,
radians: T,
axis: V,
) -> &mut Self
fn rotate_axis_at<P, V>( &mut self, position: P, radians: T, axis: V, ) -> &mut Self
Rotates around axis at given position.
Sourcefn get_rotation(&self) -> Self
fn get_rotation(&self) -> Self
Returns a pure rotation matrix for given matrix
Sourcefn get_translation(&self) -> Vec3<T>
fn get_translation(&self) -> Vec3<T>
Returns the matrix’s translation vector.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.