[−][src]Struct ultraviolet::mat::Mat3
A 3x3 square matrix.
Useful for performing linear transformations (rotation, scaling) on 3d vectors, or for performing arbitrary transformations (linear + translation, projection, etc) on homogeneous 2d vectors
Fields
cols: [Vec3; 3]
Methods
impl Mat3
[src]
pub fn new(col1: Vec3, col2: Vec3, col3: Vec3) -> Self
[src]
pub fn from_translation(trans: Vec2) -> Self
[src]
Assumes homogeneous 2d coordinates.
pub fn from_scale_homogeneous(scale: f32) -> Self
[src]
Assumes homogeneous 2d coordinates.
pub fn from_nonuniform_scale_homogeneous(scale: Vec3) -> Self
[src]
Assumes homogeneous 2d coordinates.
pub fn from_rotation_homogeneous(angle: f32) -> Self
[src]
Builds a homogeneous 2d rotation matrix (in the xy plane) from a given angle in radians.
pub fn from_scale(scale: f32) -> Self
[src]
pub fn from_nonuniform_scale(scale: Vec3) -> Self
[src]
pub fn identity() -> Self
[src]
pub fn from_euler_angles(roll: f32, pitch: f32, yaw: f32) -> Self
[src]
Angles are applied in the order roll -> pitch -> yaw.
- Yaw is rotation inside the xz plane ("around the y axis")
- Pitch is rotation inside the yz plane ("around the x axis")
- Roll is rotation inside the xy plane ("around the z axis")
Important: This function assumes a right-handed, y-up coordinate space where:
- +X axis points right
- +Y axis points up
- +Z axis points towards the viewer (i.e. out of the screen)
This means that you may see unexpected behavior when used with OpenGL or DirectX
as they use a different coordinate system. You should use the appropriate
projection matrix in projection
module to fit your use case to remedy this.
pub fn from_rotation_x(angle: f32) -> Self
[src]
Create a new rotation matrix from a rotation "about the x axis". This is here as a convenience function for users coming from other libraries; it is more proper to think of this as a rotation in the yz plane.
Important: This function assumes a right-handed, y-up coordinate space where:
- +X axis points right
- +Y axis points up
- +Z axis points towards the viewer (i.e. out of the screen)
This means that you may see unexpected behavior when used with OpenGL or DirectX
as they use a different coordinate system. You should use the appropriate
projection matrix in projection
module to fit your use case to remedy this.
pub fn from_rotation_y(angle: f32) -> Self
[src]
Create a new rotation matrix from a rotation "about the y axis". This is here as a convenience function for users coming from other libraries; it is more proper to think of this as a rotation in the xz plane.
Important: This function assumes a right-handed, y-up coordinate space where:
- +X axis points right
- +Y axis points up
- +Z axis points towards the viewer (i.e. out of the screen)
This means that you may see unexpected behavior when used with OpenGL or DirectX
as they use a different coordinate system. You should use the appropriate
projection matrix in projection
module to fit your use case to remedy this.
pub fn from_rotation_z(angle: f32) -> Self
[src]
Create a new rotation matrix from a rotation "about the z axis". This is here as a convenience function for users coming from other libraries; it is more proper to think of this as a rotation in the xy plane.
Important: This function assumes a right-handed, y-up coordinate space where:
- +X axis points right
- +Y axis points up
- +Z axis points towards the viewer (i.e. out of the screen)
This means that you may see unexpected behavior when used with OpenGL or DirectX
as they use a different coordinate system. You should use the appropriate
projection matrix in projection
module to fit your use case to remedy this.
pub fn from_angle_plane(angle: f32, plane: Bivec3) -> Self
[src]
Construct a rotation matrix given a bivector which defines a plane and rotation orientation, and a rotation angle.
plane
must be normalized!
This is the equivalent of an axis-angle rotation.
pub fn into_homogeneous(self) -> Mat4
[src]
pub fn inverse(&mut self)
[src]
If this matrix is not currently invertable, this function will return an invalid inverse. This status is not checked by the library.
pub fn inversed(&self) -> Self
[src]
If this matrix is not currently invertable, this function will return an invalid inverse. This status is not checked by the library.
pub fn transpose(&mut self)
[src]
pub fn transposed(&self) -> Self
[src]
pub fn layout() -> Layout
[src]
pub fn as_slice(&self) -> &[f32]
[src]
pub fn as_component_slice(&self) -> &[Vec3]
[src]
pub fn as_byte_slice(&self) -> &[u8]
[src]
pub fn as_mut_slice(&mut self) -> &mut [f32]
[src]
pub fn as_mut_component_slice(&mut self) -> &mut [Vec3]
[src]
pub fn as_mut_byte_slice(&mut self) -> &mut [u8]
[src]
pub fn as_ptr(&self) -> *const f32
[src]
Returns a constant unsafe pointer to the underlying data in the underlying type. This function is safe because all types here are repr(C) and can be represented as their underlying type.
Safety
It is up to the caller to correctly use this pointer and its bounds.
pub fn as_mut_ptr(&mut self) -> *mut f32
[src]
Returns a mutable unsafe pointer to the underlying data in the underlying type. This function is safe because all types here are repr(C) and can be represented as their underlying type.
Safety
It is up to the caller to correctly use this pointer and its bounds.
Trait Implementations
impl From<[f32; 9]> for Mat3
[src]
impl<'_> From<&'_ [f32; 9]> for Mat3
[src]
impl From<Rotor3> for Mat3
[src]
impl Clone for Mat3
[src]
impl Copy for Mat3
[src]
impl Default for Mat3
[src]
impl Debug for Mat3
[src]
impl Mul<Mat3> for Mat3
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: Self) -> Self
[src]
impl Mul<Vec3> for Mat3
[src]
type Output = Vec3
The resulting type after applying the *
operator.
fn mul(self, rhs: Vec3) -> Vec3
[src]
impl Index<usize> for Mat3
[src]
type Output = Vec3
The returned type after indexing.
fn index(&self, index: usize) -> &Self::Output
[src]
impl IndexMut<usize> for Mat3
[src]
Auto Trait Implementations
impl Send for Mat3
impl Sync for Mat3
impl Unpin for Mat3
impl UnwindSafe for Mat3
impl RefUnwindSafe for Mat3
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,