#[repr(C)]pub struct DTransform3 {
pub translation: DVec3,
pub rotation: DQuat,
pub scale: DVec3,
}Fields§
§translation: DVec3§rotation: DQuat§scale: DVec3Implementations§
Source§impl DTransform3
impl DTransform3
Sourcepub const ZERO: Self
pub const ZERO: Self
The degenerate zero transform.
This transforms any finite vector and point to zero. The zero transform is non-invertible.
Sourcepub const IDENTITY: Self
pub const IDENTITY: Self
The identity transform.
Multiplying a vector with this returns the same vector.
Sourcepub fn from_scale(scale: DVec3) -> Self
pub fn from_scale(scale: DVec3) -> Self
Creates an affine transform that changes scale. Note that if any scale is zero the transform will be non-invertible.
Sourcepub fn from_quat(rotation: DQuat) -> Self
pub fn from_quat(rotation: DQuat) -> Self
Creates a transform transform from the given rotation quaternion.
Sourcepub fn from_axis_angle(axis: DVec3, angle: f64) -> Self
pub fn from_axis_angle(axis: DVec3, angle: f64) -> Self
Creates a transform transform containing a 3D rotation around a normalized
rotation axis of angle (in radians).
Sourcepub fn from_rotation_x(angle: f64) -> Self
pub fn from_rotation_x(angle: f64) -> Self
Creates a transform transform containing a 3D rotation around the x axis of
angle (in radians).
Sourcepub fn from_rotation_y(angle: f64) -> Self
pub fn from_rotation_y(angle: f64) -> Self
Creates a transform transform containing a 3D rotation around the y axis of
angle (in radians).
Sourcepub fn from_rotation_z(angle: f64) -> Self
pub fn from_rotation_z(angle: f64) -> Self
Creates a transform transform containing a 3D rotation around the z axis of
angle (in radians).
Sourcepub fn from_translation(translation: DVec3) -> Self
pub fn from_translation(translation: DVec3) -> Self
Creates a transform transformation from the given 3D translation.
Sourcepub fn from_rotation_translation(rotation: DQuat, translation: DVec3) -> Self
pub fn from_rotation_translation(rotation: DQuat, translation: DVec3) -> Self
Creates a transform from the given 3D rotation and translation.
Sourcepub fn from_scale_rotation_translation(
scale: DVec3,
rotation: DQuat,
translation: DVec3,
) -> Self
pub fn from_scale_rotation_translation( scale: DVec3, rotation: DQuat, translation: DVec3, ) -> Self
Creates a transform from the given 3D scale, rotation and translation.
Sourcepub fn from_mat3(mat3: DMat3) -> Self
pub fn from_mat3(mat3: DMat3) -> Self
Creates a transform from a 3x3 matrix (expressing scale and rotation)
Note if the input matrix is non-uniform or shear, the result transform will be ill-defined.
Sourcepub fn from_mat3_translation(mat3: DMat3, translation: DVec3) -> Self
pub fn from_mat3_translation(mat3: DMat3, translation: DVec3) -> Self
Creates a transform from a 3x3 matrix (expressing scale and rotation)
Note if the input matrix is non-uniform or shear, the result transform will be ill-defined.
Sourcepub fn from_mat4(mat4: DMat4) -> Self
pub fn from_mat4(mat4: DMat4) -> Self
Creates a transform from a 4x4 matrix.
Note if the input matrix is non-uniform or shear, the result transform will be ill-defined.
Sourcepub fn to_scale_rotation_translation(&self) -> (DVec3, DQuat, DVec3)
pub fn to_scale_rotation_translation(&self) -> (DVec3, DQuat, DVec3)
Extracts scale, rotation and translation from self.
Sourcepub fn transform_point3(&self, rhs: DVec3) -> DVec3
pub fn transform_point3(&self, rhs: DVec3) -> DVec3
Transforms the given 3D points, applying scale, rotation and translation.
Sourcepub fn transform_vector3(&self, rhs: DVec3) -> DVec3
pub fn transform_vector3(&self, rhs: DVec3) -> DVec3
Transforms the given 3D vector, applying scale and rotation (but NOT translation).
Sourcepub fn is_finite(&self) -> bool
pub fn is_finite(&self) -> bool
Returns true if, and only if, all elements are finite.
If any element is either NaN, positive or negative infinity, this will return false.
Sourcepub fn abs_diff_eq(self, rhs: Self, max_abs_diff: f64) -> bool
pub fn abs_diff_eq(self, rhs: Self, max_abs_diff: f64) -> bool
Returns true if the absolute difference of all elements between self and rhs
is less than or equal to max_abs_diff.
Trait Implementations§
Source§impl AbsDiffEq for DTransform3
Available on crate feature approx only.
impl AbsDiffEq for DTransform3
approx only.Source§fn default_epsilon() -> Self::Epsilon
fn default_epsilon() -> Self::Epsilon
Source§fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
Source§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
AbsDiffEq::abs_diff_eq.Source§impl Clone for DTransform3
impl Clone for DTransform3
Source§fn clone(&self) -> DTransform3
fn clone(&self) -> DTransform3
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DTransform3
impl Debug for DTransform3
Source§impl Default for DTransform3
impl Default for DTransform3
Source§fn default() -> DTransform3
fn default() -> DTransform3
Source§impl From<DTransform3> for DAffine3
impl From<DTransform3> for DAffine3
Source§fn from(t: DTransform3) -> DAffine3
fn from(t: DTransform3) -> DAffine3
Source§impl From<DTransform3> for DMat4
impl From<DTransform3> for DMat4
Source§fn from(t: DTransform3) -> DMat4
fn from(t: DTransform3) -> DMat4
Source§impl Mul<DMat4> for DTransform3
impl Mul<DMat4> for DTransform3
Source§impl Mul<DTransform3> for DMat4
impl Mul<DTransform3> for DMat4
Source§impl Mul for DTransform3
impl Mul for DTransform3
Source§impl MulAssign for DTransform3
impl MulAssign for DTransform3
Source§fn mul_assign(&mut self, rhs: DTransform3)
fn mul_assign(&mut self, rhs: DTransform3)
*= operation. Read moreSource§impl PartialEq for DTransform3
impl PartialEq for DTransform3
Source§impl RelativeEq for DTransform3
Available on crate feature approx only.
impl RelativeEq for DTransform3
approx only.Source§fn default_max_relative() -> Self::Epsilon
fn default_max_relative() -> Self::Epsilon
Source§fn relative_eq(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_eq( &self, other: &Self, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
Source§fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
RelativeEq::relative_eq.Source§impl UlpsEq for DTransform3
Available on crate feature approx only.
impl UlpsEq for DTransform3
approx only.