pub struct Transform {
pub position: Vec3,
pub rotation: Vec3,
pub scale: Vec3,
/* private fields */
}
Expand description
Fields§
§position: Vec3
Position component of the Transform
.
rotation: Vec3
Rotation component of the Transform
.
scale: Vec3
Scale component of the Transform
.
Implementations§
Source§impl Transform
impl Transform
Sourcepub fn new_with_position(position: Vec3) -> Self
pub fn new_with_position(position: Vec3) -> Self
Create a new Transform
with an initial position.
Sourcepub fn matrix_slice(&mut self) -> &[f32]
pub fn matrix_slice(&mut self) -> &[f32]
Sourcepub fn set_position(&mut self, position: Vec3)
pub fn set_position(&mut self, position: Vec3)
Set the Transform
’s position and calculate its matrix.
Sourcepub fn set_rotation(&mut self, rotation: f32)
pub fn set_rotation(&mut self, rotation: f32)
Set the Transform
’s rotation and calculate its matrix.
Sourcepub fn get_position(&self) -> &[f32]
pub fn get_position(&self) -> &[f32]
Get the position as a slice.
Sourcepub fn get_rotation(&self) -> f32
pub fn get_rotation(&self) -> f32
Get the rotation as an f32.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Transform
impl RefUnwindSafe for Transform
impl Send for Transform
impl Sync for Transform
impl Unpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.