pub struct Transformation { /* private fields */ }
Expand description
A transformation corresponds to a translation of a rotation of a scaling
The rotation here is encoded by a Quaternion
Implementations§
Source§impl Transformation
impl Transformation
Sourcepub fn with_scale(self, scale: Vec3) -> Self
pub fn with_scale(self, scale: Vec3) -> Self
Set the scaling of a transformation
Sourcepub fn with_translation(self, translation: Vec3) -> Self
pub fn with_translation(self, translation: Vec3) -> Self
Set the translation of a transformation
Sourcepub fn with_rotation(self, rotation: Quat) -> Self
pub fn with_rotation(self, rotation: Quat) -> Self
Set the rotation of a transformation
Sourcepub fn translation(&mut self) -> Vec3
pub fn translation(&mut self) -> Vec3
Set the translation of a transformation
Sourcepub fn set_translation(&mut self, translation: Vec3)
pub fn set_translation(&mut self, translation: Vec3)
Set the translation of a transformation
Sourcepub fn set_rotation(&mut self, rotation: Quat)
pub fn set_rotation(&mut self, rotation: Quat)
Set the rotation of a transformation
Sourcepub fn combine(&mut self, base: &Self, other: &Self)
pub fn combine(&mut self, base: &Self, other: &Self)
Combine two transformations into this
To operate correctly the scales must be
Sourcepub fn translate(&mut self, translation: &Vec3, scale: f32)
pub fn translate(&mut self, translation: &Vec3, scale: f32)
Pre-apply a translation to the transformation
Sourcepub fn rotate_axis_angle(&mut self, axis: &Vec3, angle: f32)
pub fn rotate_axis_angle(&mut self, axis: &Vec3, angle: f32)
Rotate the transformation by an angle about an axis
Sourcepub fn rotate_by(&mut self, quaternion: &Quat)
pub fn rotate_by(&mut self, quaternion: &Quat)
Rotate the transformation by an angle about an axis
Sourcepub fn mat4_inverse(&self) -> Mat4
pub fn mat4_inverse(&self) -> Mat4
Create a mat4 from the inverse of this Transformation
Sourcepub fn from_mat4(&mut self, m: Mat4)
pub fn from_mat4(&mut self, m: Mat4)
Set this translation from a Mat4 (assuming it can be done)
Sourcepub fn mat4_after(&self, pre_mat: &Mat4) -> Mat4
pub fn mat4_after(&self, pre_mat: &Mat4) -> Mat4
Calculate a Mat4 of this transformation premultiplied by another Mat4
Sourcepub fn interpolate(&mut self, t: f32, in0: &Self, in1: &Self)
pub fn interpolate(&mut self, t: f32, in0: &Self, in1: &Self)
Set this transformation to be an interpolation between two others
Trait Implementations§
Source§impl Clone for Transformation
impl Clone for Transformation
Source§fn clone(&self) -> Transformation
fn clone(&self) -> Transformation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more