pub struct Transform3d { /* private fields */ }Expand description
Model transform with translation, rotation, and positive per-axis scale.
Implementations§
Source§impl Transform3d
impl Transform3d
Sourcepub fn new(
translation: Vec3,
rotation: Rotation3d,
scale: Vec3,
) -> Result<Self, Pseudo3dError>
pub fn new( translation: Vec3, rotation: Rotation3d, scale: Vec3, ) -> Result<Self, Pseudo3dError>
Builds a model transform. Every scale component must be positive.
Sourcepub fn from_rotation_scale(
rotation: Rotation3d,
scale: f32,
) -> Result<Self, Pseudo3dError>
pub fn from_rotation_scale( rotation: Rotation3d, scale: f32, ) -> Result<Self, Pseudo3dError>
Builds a transform with the same positive finite scale on every axis.
Sourcepub const fn translation(self) -> Vec3
pub const fn translation(self) -> Vec3
Returns model translation in world units.
Sourcepub const fn rotation(self) -> Rotation3d
pub const fn rotation(self) -> Rotation3d
Returns model rotation.
Sourcepub fn transform_point(self, point: Vec3) -> Result<Vec3, Pseudo3dError>
pub fn transform_point(self, point: Vec3) -> Result<Vec3, Pseudo3dError>
Applies scale, then rotation, then translation to a model-space point.
Trait Implementations§
Source§impl Clone for Transform3d
impl Clone for Transform3d
Source§fn clone(&self) -> Transform3d
fn clone(&self) -> Transform3d
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Transform3d
Source§impl Debug for Transform3d
impl Debug for Transform3d
Source§impl PartialEq for Transform3d
impl PartialEq for Transform3d
impl StructuralPartialEq for Transform3d
Auto Trait Implementations§
impl Freeze for Transform3d
impl RefUnwindSafe for Transform3d
impl Send for Transform3d
impl Sync for Transform3d
impl Unpin for Transform3d
impl UnsafeUnpin for Transform3d
impl UnwindSafe for Transform3d
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