#[repr(C, packed)]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, packed)]
.
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: BaseFloat> Matrix3<S>
impl<S: BaseFloat> Matrix3<S>
sourcepub fn new(
c0r0: S,
c0r1: S,
c0r2: S,
c1r0: S,
c1r1: S,
c1r2: S,
c2r0: S,
c2r1: S,
c2r2: S
) -> Matrix3<S>
pub fn new( c0r0: S, c0r1: S, c0r2: S, c1r0: S, c1r1: S, c1r2: S, c2r0: S, c2r1: S, c2r2: S ) -> Matrix3<S>
Create a new matrix, providing values for each index.
sourcepub fn from_cols(c0: Vector3<S>, c1: Vector3<S>, c2: Vector3<S>) -> Matrix3<S>
pub fn from_cols(c0: Vector3<S>, c1: Vector3<S>, c2: Vector3<S>) -> Matrix3<S>
Create a new matrix, providing columns.
sourcepub fn look_at(dir: Vector3<S>, up: Vector3<S>) -> Matrix3<S>
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 from_angle_x(theta: Rad<S>) -> Matrix3<S>
pub fn from_angle_x(theta: Rad<S>) -> Matrix3<S>
Create a rotation matrix from a rotation around the x
axis (pitch).
sourcepub fn from_angle_y(theta: Rad<S>) -> Matrix3<S>
pub fn from_angle_y(theta: Rad<S>) -> Matrix3<S>
Create a rotation matrix from a rotation around the y
axis (yaw).
sourcepub fn from_angle_z(theta: Rad<S>) -> Matrix3<S>
pub fn from_angle_z(theta: Rad<S>) -> Matrix3<S>
Create a rotation matrix from a rotation around the z
axis (roll).
sourcepub fn from_axis_angle(axis: Vector3<S>, angle: Rad<S>) -> Matrix3<S>
pub fn from_axis_angle(axis: Vector3<S>, angle: Rad<S>) -> Matrix3<S>
Create a rotation matrix from an angle around an arbitrary axis.
The specified axis must be normalized, or it represents an invalid rotation.
Trait Implementations§
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 as Angle>::Unitless>where
A: Angle + Into<Rad<<A as Angle>::Unitless>>,
impl<A> From<Euler<A>> for Matrix3<<A as Angle>::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 + Copy> PartialEq<Matrix3<S>> for Matrix3<S>
impl<S: PartialEq + Copy> PartialEq<Matrix3<S>> for Matrix3<S>
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_invertible(&self) -> bool
fn is_invertible(&self) -> bool
source§fn is_identity(&self) -> bool
fn is_identity(&self) -> bool
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 one() -> Matrix3<S>
fn one() -> 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 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 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 one() -> Matrix3<S>
fn one() -> 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.