Struct pathfinder_geometry::transform3d::Transform4F

source ·
#[repr(C)]
pub struct Transform4F { pub c0: F32x4, pub c1: F32x4, pub c2: F32x4, pub c3: F32x4, }
Expand description

An transform, optimized with SIMD.

In column-major order.

Fields§

§c0: F32x4§c1: F32x4§c2: F32x4§c3: F32x4

Implementations§

source§

impl Transform4F

source

pub fn row_major( m00: f32, m01: f32, m02: f32, m03: f32, m10: f32, m11: f32, m12: f32, m13: f32, m20: f32, m21: f32, m22: f32, m23: f32, m30: f32, m31: f32, m32: f32, m33: f32, ) -> Transform4F

source

pub fn from_scale(scale: Vector4F) -> Transform4F

source

pub fn from_uniform_scale(factor: f32) -> Transform4F

source

pub fn from_translation(translation: Vector4F) -> Transform4F

source

pub fn from_rotation(yaw: f32, pitch: f32, roll: f32) -> Transform4F

source

pub fn from_rotation_quaternion(q: F32x4) -> Transform4F

Creates a rotation matrix from the given quaternion.

The quaternion is expected to be packed into a SIMD type (x, y, z, w) corresponding to x + yi + zj + wk.

source

pub fn from_ortho( left: f32, right: f32, bottom: f32, top: f32, near_val: f32, far_val: f32, ) -> Transform4F

Just like glOrtho().

source

pub fn lerp(&self, weight: f32, other: &Transform4F) -> Transform4F

Linearly interpolate between transforms

source

pub fn from_perspective( fov_y: f32, aspect: f32, z_near: f32, z_far: f32, ) -> Transform4F

Just like gluPerspective().

source

pub fn looking_at(eye: Vector3F, center: Vector3F, up: Vector3F) -> Transform4F

Just like gluLookAt().

source

pub fn from_submatrices( a: Matrix2x2F, b: Matrix2x2F, c: Matrix2x2F, d: Matrix2x2F, ) -> Transform4F

source

pub fn rotate(&self, yaw: f32, pitch: f32, roll: f32) -> Transform4F

source

pub fn scale(&self, scale: Vector4F) -> Transform4F

source

pub fn uniform_scale(&self, scale: f32) -> Transform4F

source

pub fn translate(&self, translation: Vector4F) -> Transform4F

source

pub fn upper_left(&self) -> Matrix2x2F

source

pub fn upper_right(&self) -> Matrix2x2F

source

pub fn lower_left(&self) -> Matrix2x2F

source

pub fn lower_right(&self) -> Matrix2x2F

source

pub fn inverse(&self) -> Transform4F

source

pub fn approx_eq(&self, other: &Transform4F, epsilon: f32) -> bool

source

pub fn as_ptr(&self) -> *const f32

source

pub fn to_columns(&self) -> [F32x4; 4]

Trait Implementations§

source§

impl Clone for Transform4F

source§

fn clone(&self) -> Transform4F

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Transform4F

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Transform4F

source§

fn default() -> Transform4F

Returns the “default value” for a type. Read more
source§

impl Mul<Transform4F> for Perspective

§

type Output = Perspective

The resulting type after applying the * operator.
source§

fn mul(self, other: Transform4F) -> Perspective

Performs the * operation. Read more
source§

impl Mul<Vector4F> for Transform4F

§

type Output = Vector4F

The resulting type after applying the * operator.
source§

fn mul(self, vector: Vector4F) -> Vector4F

Performs the * operation. Read more
source§

impl Mul for Transform4F

§

type Output = Transform4F

The resulting type after applying the * operator.
source§

fn mul(self, other: Transform4F) -> Transform4F

Performs the * operation. Read more
source§

impl MulAssign for Transform4F

source§

fn mul_assign(&mut self, other: Transform4F)

Performs the *= operation. Read more
source§

impl PartialEq for Transform4F

source§

fn eq(&self, other: &Transform4F) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for Transform4F

source§

impl StructuralPartialEq for Transform4F

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.