pub type Matrix4<T> = Matrix<T, U4, U4, ArrayStorage<T, 4, 4>>;
Expand description
A stack-allocated, column-major, 4x4 square matrix.
Because this is an alias, not all its methods are listed here. See the Matrix
type too.
Implementations§
source§impl<T: RealField> Matrix4<T>
impl<T: RealField> Matrix4<T>
sourcepub fn new_rotation(axisangle: Vector3<T>) -> Self
pub fn new_rotation(axisangle: Vector3<T>) -> Self
Builds a 3D homogeneous rotation matrix from an axis and an angle (multiplied together).
Returns the identity matrix if the given argument is zero.
sourcepub fn new_rotation_wrt_point(axisangle: Vector3<T>, pt: Point3<T>) -> Self
pub fn new_rotation_wrt_point(axisangle: Vector3<T>, pt: Point3<T>) -> Self
Builds a 3D homogeneous rotation matrix from an axis and an angle (multiplied together).
Returns the identity matrix if the given argument is zero.
sourcepub fn new_nonuniform_scaling_wrt_point(
scaling: &Vector3<T>,
pt: &Point3<T>
) -> Self
pub fn new_nonuniform_scaling_wrt_point(
scaling: &Vector3<T>,
pt: &Point3<T>
) -> Self
Creates a new homogeneous matrix that applies a scaling factor for each dimension with respect to point.
Can be used to implement zoom_to
functionality.
sourcepub fn from_scaled_axis(axisangle: Vector3<T>) -> Self
pub fn from_scaled_axis(axisangle: Vector3<T>) -> Self
Builds a 3D homogeneous rotation matrix from an axis and an angle (multiplied together).
Returns the identity matrix if the given argument is zero.
This is identical to Self::new_rotation
.
sourcepub fn from_euler_angles(roll: T, pitch: T, yaw: T) -> Self
pub fn from_euler_angles(roll: T, pitch: T, yaw: T) -> Self
Creates a new rotation from Euler angles.
The primitive rotations are applied in order: 1 roll − 2 pitch − 3 yaw.
sourcepub fn from_axis_angle(axis: &Unit<Vector3<T>>, angle: T) -> Self
pub fn from_axis_angle(axis: &Unit<Vector3<T>>, angle: T) -> Self
Builds a 3D homogeneous rotation matrix from an axis and a rotation angle.
sourcepub fn new_orthographic(
left: T,
right: T,
bottom: T,
top: T,
znear: T,
zfar: T
) -> Self
pub fn new_orthographic(
left: T,
right: T,
bottom: T,
top: T,
znear: T,
zfar: T
) -> Self
Creates a new homogeneous matrix for an orthographic projection.
sourcepub fn new_perspective(aspect: T, fovy: T, znear: T, zfar: T) -> Self
pub fn new_perspective(aspect: T, fovy: T, znear: T, zfar: T) -> Self
Creates a new homogeneous matrix for a perspective projection.
sourcepub fn face_towards(eye: &Point3<T>, target: &Point3<T>, up: &Vector3<T>) -> Self
pub fn face_towards(eye: &Point3<T>, target: &Point3<T>, up: &Vector3<T>) -> Self
Creates an isometry that corresponds to the local frame of an observer standing at the
point eye
and looking toward target
.
It maps the view direction target - eye
to the positive z
axis and the origin to the
eye
.
sourcepub fn new_observer_frame(
eye: &Point3<T>,
target: &Point3<T>,
up: &Vector3<T>
) -> Self
👎Deprecated: renamed to face_towards
pub fn new_observer_frame(
eye: &Point3<T>,
target: &Point3<T>,
up: &Vector3<T>
) -> Self
face_towards
Deprecated: Use Matrix4::face_towards
instead.
sourcepub fn look_at_rh(eye: &Point3<T>, target: &Point3<T>, up: &Vector3<T>) -> Self
pub fn look_at_rh(eye: &Point3<T>, target: &Point3<T>, up: &Vector3<T>) -> Self
Builds a right-handed look-at view matrix.
sourcepub fn look_at_lh(eye: &Point3<T>, target: &Point3<T>, up: &Vector3<T>) -> Self
pub fn look_at_lh(eye: &Point3<T>, target: &Point3<T>, up: &Vector3<T>) -> Self
Builds a left-handed look-at view matrix.