#[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<Matrix3<S>> for Matrix3<S>
impl<S: BaseFloat> AbsDiffEq<Matrix3<S>> 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<Matrix3<S>> for Matrix3<S>
impl<S: BaseFloat + AddAssign<S>> AddAssign<Matrix3<S>> 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<A> From<Euler<A>> for Matrix3<A::Unitless>where
A: Angle + Into<Rad<<A as Angle>::Unitless>>,
impl<A> From<Euler<A>> for Matrix3<A::Unitless>where A: Angle + Into<Rad<<A as Angle>::Unitless>>,
source§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: PartialEq> PartialEq<Matrix3<S>> for Matrix3<S>
impl<S: PartialEq> PartialEq<Matrix3<S>> for Matrix3<S>
source§impl<S: BaseFloat> RelativeEq<Matrix3<S>> for Matrix3<S>
impl<S: BaseFloat> RelativeEq<Matrix3<S>> 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<Matrix3<S>> for Matrix3<S>
impl<S: BaseFloat + SubAssign<S>> SubAssign<Matrix3<S>> 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.