Expand description
A stack-allocated, column-major, 4x4 square matrix.
Implementations§
source§impl<N: Real> Matrix4<N>
impl<N: Real> Matrix4<N>
sourcepub fn new_rotation(axisangle: Vector3<N>) -> Self
pub fn new_rotation(axisangle: Vector3<N>) -> 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<N>, pt: Point3<N>) -> Self
pub fn new_rotation_wrt_point(axisangle: Vector3<N>, pt: Point3<N>) -> 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 from_scaled_axis(axisangle: Vector3<N>) -> Self
pub fn from_scaled_axis(axisangle: Vector3<N>) -> 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: N, pitch: N, yaw: N) -> Self
pub fn from_euler_angles(roll: N, pitch: N, yaw: N) -> 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<N>>, angle: N) -> Self
pub fn from_axis_angle(axis: &Unit<Vector3<N>>, angle: N) -> Self
Builds a 3D homogeneous rotation matrix from an axis and a rotation angle.
sourcepub fn new_orthographic(
left: N,
right: N,
bottom: N,
top: N,
znear: N,
zfar: N
) -> Self
pub fn new_orthographic(
left: N,
right: N,
bottom: N,
top: N,
znear: N,
zfar: N
) -> Self
Creates a new homogeneous matrix for an orthographic projection.
sourcepub fn new_perspective(aspect: N, fovy: N, znear: N, zfar: N) -> Self
pub fn new_perspective(aspect: N, fovy: N, znear: N, zfar: N) -> Self
Creates a new homogeneous matrix for a perspective projection.
sourcepub fn new_observer_frame(
eye: &Point3<N>,
target: &Point3<N>,
up: &Vector3<N>
) -> Self
pub fn new_observer_frame(
eye: &Point3<N>,
target: &Point3<N>,
up: &Vector3<N>
) -> 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 look_at_rh(eye: &Point3<N>, target: &Point3<N>, up: &Vector3<N>) -> Self
pub fn look_at_rh(eye: &Point3<N>, target: &Point3<N>, up: &Vector3<N>) -> Self
Builds a right-handed look-at view matrix.
sourcepub fn look_at_lh(eye: &Point3<N>, target: &Point3<N>, up: &Vector3<N>) -> Self
pub fn look_at_lh(eye: &Point3<N>, target: &Point3<N>, up: &Vector3<N>) -> Self
Builds a left-handed look-at view matrix.