pub struct Transform {
pub translation: Vec3,
pub rotation: Quat,
pub scale: Vec3,
}Expand description
A translation, rotation, and scale transform.
Fields§
§translation: Vec3Local translation.
rotation: QuatLocal rotation.
scale: Vec3Local scale.
Implementations§
Source§impl Transform
impl Transform
Sourcepub const fn new(translation: Vec3, rotation: Quat, scale: Vec3) -> Self
pub const fn new(translation: Vec3, rotation: Quat, scale: Vec3) -> Self
Creates a transform from translation, rotation, and scale.
Sourcepub const fn from_translation(value: Vec3) -> Self
pub const fn from_translation(value: Vec3) -> Self
Creates a translation transform.
Sourcepub const fn from_rotation(value: Quat) -> Self
pub const fn from_rotation(value: Quat) -> Self
Creates a rotation transform.
Sourcepub const fn from_scale(value: Vec3) -> Self
pub const fn from_scale(value: Vec3) -> Self
Creates a scale transform.
Sourcepub fn looking_at(eye: Vec3, target: Vec3, up: Vec3) -> Self
pub fn looking_at(eye: Vec3, target: Vec3, up: Vec3) -> Self
Creates a transform that looks from eye toward target.
Sourcepub fn mul_transform(self, rhs: Self) -> Self
pub fn mul_transform(self, rhs: Self) -> Self
Composes two transforms.
Sourcepub fn translate_by(self, delta: Vec3) -> Self
pub fn translate_by(self, delta: Vec3) -> Self
Returns this transform translated by delta.
Trait Implementations§
impl Copy for Transform
impl StructuralPartialEq for Transform
Auto Trait Implementations§
impl Freeze for Transform
impl RefUnwindSafe for Transform
impl Send for Transform
impl Sync for Transform
impl Unpin for Transform
impl UnsafeUnpin for Transform
impl UnwindSafe for Transform
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