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
impl Transform4F
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
pub fn from_scale(scale: Vector4F) -> Transform4F
pub fn from_uniform_scale(factor: f32) -> Transform4F
pub fn from_translation(translation: Vector4F) -> Transform4F
pub fn from_rotation(yaw: f32, pitch: f32, roll: f32) -> Transform4F
sourcepub fn from_rotation_quaternion(q: F32x4) -> Transform4F
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.
sourcepub fn from_ortho(
left: f32,
right: f32,
bottom: f32,
top: f32,
near_val: f32,
far_val: f32,
) -> Transform4F
pub fn from_ortho( left: f32, right: f32, bottom: f32, top: f32, near_val: f32, far_val: f32, ) -> Transform4F
Just like glOrtho()
.
sourcepub fn lerp(&self, weight: f32, other: &Transform4F) -> Transform4F
pub fn lerp(&self, weight: f32, other: &Transform4F) -> Transform4F
Linearly interpolate between transforms
sourcepub fn from_perspective(
fov_y: f32,
aspect: f32,
z_near: f32,
z_far: f32,
) -> Transform4F
pub fn from_perspective( fov_y: f32, aspect: f32, z_near: f32, z_far: f32, ) -> Transform4F
Just like gluPerspective()
.
sourcepub fn looking_at(eye: Vector3F, center: Vector3F, up: Vector3F) -> Transform4F
pub fn looking_at(eye: Vector3F, center: Vector3F, up: Vector3F) -> Transform4F
Just like gluLookAt()
.
pub fn from_submatrices( a: Matrix2x2F, b: Matrix2x2F, c: Matrix2x2F, d: Matrix2x2F, ) -> Transform4F
pub fn rotate(&self, yaw: f32, pitch: f32, roll: f32) -> Transform4F
pub fn scale(&self, scale: Vector4F) -> Transform4F
pub fn uniform_scale(&self, scale: f32) -> Transform4F
pub fn translate(&self, translation: Vector4F) -> Transform4F
pub fn upper_left(&self) -> Matrix2x2F
pub fn upper_right(&self) -> Matrix2x2F
pub fn lower_left(&self) -> Matrix2x2F
pub fn lower_right(&self) -> Matrix2x2F
pub fn inverse(&self) -> Transform4F
pub fn approx_eq(&self, other: &Transform4F, epsilon: f32) -> bool
pub fn as_ptr(&self) -> *const f32
pub fn to_columns(&self) -> [F32x4; 4]
Trait Implementations§
source§impl Clone for Transform4F
impl Clone for Transform4F
source§fn clone(&self) -> Transform4F
fn clone(&self) -> Transform4F
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Transform4F
impl Debug for Transform4F
source§impl Default for Transform4F
impl Default for Transform4F
source§fn default() -> Transform4F
fn default() -> Transform4F
Returns the “default value” for a type. Read more
source§impl Mul<Transform4F> for Perspective
impl Mul<Transform4F> for Perspective
§type Output = Perspective
type Output = Perspective
The resulting type after applying the
*
operator.source§fn mul(self, other: Transform4F) -> Perspective
fn mul(self, other: Transform4F) -> Perspective
Performs the
*
operation. Read moresource§impl Mul<Vector4F> for Transform4F
impl Mul<Vector4F> for Transform4F
source§impl Mul for Transform4F
impl Mul for Transform4F
§type Output = Transform4F
type Output = Transform4F
The resulting type after applying the
*
operator.source§fn mul(self, other: Transform4F) -> Transform4F
fn mul(self, other: Transform4F) -> Transform4F
Performs the
*
operation. Read moresource§impl MulAssign for Transform4F
impl MulAssign for Transform4F
source§fn mul_assign(&mut self, other: Transform4F)
fn mul_assign(&mut self, other: Transform4F)
Performs the
*=
operation. Read moresource§impl PartialEq for Transform4F
impl PartialEq for Transform4F
source§fn eq(&self, other: &Transform4F) -> bool
fn eq(&self, other: &Transform4F) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for Transform4F
impl StructuralPartialEq for Transform4F
Auto Trait Implementations§
impl Freeze for Transform4F
impl RefUnwindSafe for Transform4F
impl Send for Transform4F
impl Sync for Transform4F
impl Unpin for Transform4F
impl UnwindSafe for Transform4F
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