pub struct Mat4(pub [f32; 16]);Expand description
A 4×4 matrix, column-major: m[col * 4 + row].
Tuple Fields§
§0: [f32; 16]Implementations§
Source§impl Mat4
impl Mat4
pub const IDENTITY: Mat4
pub fn translation(v: Vec3) -> Mat4
pub fn scaling(v: Vec3) -> Mat4
Sourcepub fn rotation_x(a: f32) -> Mat4
pub fn rotation_x(a: f32) -> Mat4
Turned a radians about x (right-handed, as Axis.XP).
pub fn rotation_y(a: f32) -> Mat4
pub fn rotation_z(a: f32) -> Mat4
Sourcepub fn rotation_zyx(r: Vec3) -> Mat4
pub fn rotation_zyx(r: Vec3) -> Mat4
JOML’s rotationZYX(z, y, x) (a model part’s turn) — z, then y,
then x applied to the vector last.
pub fn transform_point(&self, p: Vec3) -> Vec3
Sourcepub fn transform_dir(&self, d: Vec3) -> Vec3
pub fn transform_dir(&self, d: Vec3) -> Vec3
A direction: turned and scaled, not moved.
Sourcepub fn transform_normal(&self, n: Vec3) -> Vec3
pub fn transform_normal(&self, n: Vec3) -> Vec3
A normal, kept a unit vector (good for rotations and uniform scales, which is what bodies use).
Trait Implementations§
impl Copy for Mat4
impl StructuralPartialEq for Mat4
Auto Trait Implementations§
impl Freeze for Mat4
impl RefUnwindSafe for Mat4
impl Send for Mat4
impl Sync for Mat4
impl Unpin for Mat4
impl UnsafeUnpin for Mat4
impl UnwindSafe for Mat4
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more