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
ModelPart’s turn: JOML rotationZYX(z, y, x) — z, then y, then x
applied to the vector last.
Sourcepub fn part(pivot: Vec3, rotation: Vec3, scale: Vec3) -> Mat4
pub fn part(pivot: Vec3, rotation: Vec3, scale: Vec3) -> Mat4
ModelPart.translateAndRotate: to the pivot, turned, scaled.
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> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.