#[repr(C)]pub struct Matrix3<S> {
pub x: Vector3<S>,
pub y: Vector3<S>,
pub z: Vector3<S>,
}
Expand description
A 3 x 3, column major matrix
This type is marked as #[repr(C)]
.
Fields§
§x: Vector3<S>
The first column of the matrix.
y: Vector3<S>
The second column of the matrix.
z: Vector3<S>
The third column of the matrix.
Implementations§
Source§impl<S> Matrix3<S>
impl<S> Matrix3<S>
Source§impl<S: BaseFloat> Matrix3<S>
impl<S: BaseFloat> Matrix3<S>
Sourcepub fn from_translation(v: Vector2<S>) -> Matrix3<S>
pub fn from_translation(v: Vector2<S>) -> Matrix3<S>
Create a homogeneous transformation matrix from a translation vector.
Sourcepub fn from_scale(value: S) -> Matrix3<S>
pub fn from_scale(value: S) -> Matrix3<S>
Create a homogeneous transformation matrix from a scale value.
Sourcepub fn from_nonuniform_scale(x: S, y: S) -> Matrix3<S>
pub fn from_nonuniform_scale(x: S, y: S) -> Matrix3<S>
Create a homogeneous transformation matrix from a set of scale values.
Sourcepub fn look_at(dir: Vector3<S>, up: Vector3<S>) -> Matrix3<S>
👎Deprecated: Use Matrix3::look_to_lh
pub fn look_at(dir: Vector3<S>, up: Vector3<S>) -> Matrix3<S>
Create a rotation matrix that will cause a vector to point at
dir
, using up
for orientation.
Sourcepub fn look_to_lh(dir: Vector3<S>, up: Vector3<S>) -> Matrix3<S>
pub fn look_to_lh(dir: Vector3<S>, up: Vector3<S>) -> Matrix3<S>
Create a rotation matrix that will cause a vector to point at
dir
, using up
for orientation.
Sourcepub fn look_to_rh(dir: Vector3<S>, up: Vector3<S>) -> Matrix3<S>
pub fn look_to_rh(dir: Vector3<S>, up: Vector3<S>) -> Matrix3<S>
Create a rotation matrix that will cause a vector to point at
dir
, using up
for orientation.
Sourcepub fn from_angle_x<A: Into<Rad<S>>>(theta: A) -> Matrix3<S>
pub fn from_angle_x<A: Into<Rad<S>>>(theta: A) -> Matrix3<S>
Create a rotation matrix from a rotation around the x
axis (pitch).
Sourcepub fn from_angle_y<A: Into<Rad<S>>>(theta: A) -> Matrix3<S>
pub fn from_angle_y<A: Into<Rad<S>>>(theta: A) -> Matrix3<S>
Create a rotation matrix from a rotation around the y
axis (yaw).
Sourcepub fn from_angle_z<A: Into<Rad<S>>>(theta: A) -> Matrix3<S>
pub fn from_angle_z<A: Into<Rad<S>>>(theta: A) -> Matrix3<S>
Create a rotation matrix from a rotation around the z
axis (roll).
Trait Implementations§
Source§impl<S: BaseFloat> AbsDiffEq for Matrix3<S>
impl<S: BaseFloat> AbsDiffEq for Matrix3<S>
Source§fn default_epsilon() -> S::Epsilon
fn default_epsilon() -> S::Epsilon
Source§fn abs_diff_eq(&self, other: &Self, epsilon: S::Epsilon) -> bool
fn abs_diff_eq(&self, other: &Self, epsilon: S::Epsilon) -> bool
Source§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
AbsDiffEq::abs_diff_eq
.Source§impl<S: BaseFloat + AddAssign<S>> AddAssign for Matrix3<S>
impl<S: BaseFloat + AddAssign<S>> AddAssign for Matrix3<S>
Source§fn add_assign(&mut self, other: Matrix3<S>)
fn add_assign(&mut self, other: Matrix3<S>)
+=
operation. Read moreSource§impl<S: BaseFloat + DivAssign<S>> DivAssign<S> for Matrix3<S>
impl<S: BaseFloat + DivAssign<S>> DivAssign<S> for Matrix3<S>
Source§fn div_assign(&mut self, scalar: S)
fn div_assign(&mut self, scalar: S)
/=
operation. Read moreSource§impl<S: BaseFloat> From<Matrix3<S>> for Quaternion<S>
impl<S: BaseFloat> From<Matrix3<S>> for Quaternion<S>
Source§fn from(mat: Matrix3<S>) -> Quaternion<S>
fn from(mat: Matrix3<S>) -> Quaternion<S>
Convert the matrix to a quaternion
Source§impl<S: BaseFloat> From<Quaternion<S>> for Matrix3<S>
impl<S: BaseFloat> From<Quaternion<S>> for Matrix3<S>
Source§fn from(quat: Quaternion<S>) -> Matrix3<S>
fn from(quat: Quaternion<S>) -> Matrix3<S>
Convert the quaternion to a 3 x 3 rotation matrix.
Source§impl<S: BaseFloat> Matrix for Matrix3<S>
impl<S: BaseFloat> Matrix for Matrix3<S>
Source§impl<S: BaseFloat + MulAssign<S>> MulAssign<S> for Matrix3<S>
impl<S: BaseFloat + MulAssign<S>> MulAssign<S> for Matrix3<S>
Source§fn mul_assign(&mut self, scalar: S)
fn mul_assign(&mut self, scalar: S)
*=
operation. Read moreSource§impl<S: BaseFloat> RelativeEq for Matrix3<S>
impl<S: BaseFloat> RelativeEq for Matrix3<S>
Source§fn default_max_relative() -> S::Epsilon
fn default_max_relative() -> S::Epsilon
Source§fn relative_eq(
&self,
other: &Self,
epsilon: S::Epsilon,
max_relative: S::Epsilon,
) -> bool
fn relative_eq( &self, other: &Self, epsilon: S::Epsilon, max_relative: S::Epsilon, ) -> bool
Source§fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
RelativeEq::relative_eq
.Source§impl<S: BaseFloat + RemAssign<S>> RemAssign<S> for Matrix3<S>
impl<S: BaseFloat + RemAssign<S>> RemAssign<S> for Matrix3<S>
Source§fn rem_assign(&mut self, scalar: S)
fn rem_assign(&mut self, scalar: S)
%=
operation. Read moreSource§impl<S: BaseFloat> SquareMatrix for Matrix3<S>
impl<S: BaseFloat> SquareMatrix for Matrix3<S>
Source§fn from_value(value: S) -> Matrix3<S>
fn from_value(value: S) -> Matrix3<S>
Source§fn from_diagonal(value: Vector3<S>) -> Matrix3<S>
fn from_diagonal(value: Vector3<S>) -> Matrix3<S>
Source§fn transpose_self(&mut self)
fn transpose_self(&mut self)
Source§fn determinant(&self) -> S
fn determinant(&self) -> S
Source§fn invert(&self) -> Option<Matrix3<S>>
fn invert(&self) -> Option<Matrix3<S>>
m.mul_m(m.invert())
is
the identity matrix. Returns None
if this matrix is not invertible
(has a determinant of zero).Source§fn is_diagonal(&self) -> bool
fn is_diagonal(&self) -> bool
Source§fn is_symmetric(&self) -> bool
fn is_symmetric(&self) -> bool
Source§fn identity() -> Self
fn identity() -> Self
Source§fn trace(&self) -> Self::Scalar
fn trace(&self) -> Self::Scalar
Source§fn is_identity(&self) -> boolwhere
Self: UlpsEq,
fn is_identity(&self) -> boolwhere
Self: UlpsEq,
Source§impl<S: BaseFloat + SubAssign<S>> SubAssign for Matrix3<S>
impl<S: BaseFloat + SubAssign<S>> SubAssign for Matrix3<S>
Source§fn sub_assign(&mut self, other: Matrix3<S>)
fn sub_assign(&mut self, other: Matrix3<S>)
-=
operation. Read moreSource§impl<S: BaseFloat> Transform<Point2<S>> for Matrix3<S>
impl<S: BaseFloat> Transform<Point2<S>> for Matrix3<S>
Source§fn look_at(eye: Point2<S>, center: Point2<S>, up: Vector2<S>) -> Matrix3<S>
fn look_at(eye: Point2<S>, center: Point2<S>, up: Vector2<S>) -> Matrix3<S>
center
from
eye
, using up
for orientation.Source§fn look_at_lh(eye: Point2<S>, center: Point2<S>, up: Vector2<S>) -> Matrix3<S>
fn look_at_lh(eye: Point2<S>, center: Point2<S>, up: Vector2<S>) -> Matrix3<S>
center
from
eye
, using up
for orientation.Source§fn look_at_rh(eye: Point2<S>, center: Point2<S>, up: Vector2<S>) -> Matrix3<S>
fn look_at_rh(eye: Point2<S>, center: Point2<S>, up: Vector2<S>) -> Matrix3<S>
center
from
eye
, using up
for orientation.Source§fn transform_vector(&self, vec: Vector2<S>) -> Vector2<S>
fn transform_vector(&self, vec: Vector2<S>) -> Vector2<S>
Source§fn transform_point(&self, point: Point2<S>) -> Point2<S>
fn transform_point(&self, point: Point2<S>) -> Point2<S>
Source§fn concat(&self, other: &Matrix3<S>) -> Matrix3<S>
fn concat(&self, other: &Matrix3<S>) -> Matrix3<S>
Source§fn inverse_transform(&self) -> Option<Matrix3<S>>
fn inverse_transform(&self) -> Option<Matrix3<S>>
Source§fn inverse_transform_vector(&self, vec: P::Diff) -> Option<P::Diff>
fn inverse_transform_vector(&self, vec: P::Diff) -> Option<P::Diff>
Source§fn concat_self(&mut self, other: &Self)
fn concat_self(&mut self, other: &Self)
Source§impl<S: BaseFloat> Transform<Point3<S>> for Matrix3<S>
impl<S: BaseFloat> Transform<Point3<S>> for Matrix3<S>
Source§fn look_at(eye: Point3<S>, center: Point3<S>, up: Vector3<S>) -> Matrix3<S>
fn look_at(eye: Point3<S>, center: Point3<S>, up: Vector3<S>) -> Matrix3<S>
center
from
eye
, using up
for orientation.Source§fn look_at_lh(eye: Point3<S>, center: Point3<S>, up: Vector3<S>) -> Matrix3<S>
fn look_at_lh(eye: Point3<S>, center: Point3<S>, up: Vector3<S>) -> Matrix3<S>
center
from
eye
, using up
for orientation.Source§fn look_at_rh(eye: Point3<S>, center: Point3<S>, up: Vector3<S>) -> Matrix3<S>
fn look_at_rh(eye: Point3<S>, center: Point3<S>, up: Vector3<S>) -> Matrix3<S>
center
from
eye
, using up
for orientation.