[−][src]Struct duku::Transform
Represents transformation in separate components.
Used as an easier way to operate with transformations than matrices
Example
let transform = Transform { position: Vector3::new(1.0, 2.0, 3.0), scale: Vector3::uniform(5.0), rotation: Quaternion::euler_rotation(90.0, 0.0, 45.0), }; let matrix = Matrix4::from(transform); // use matrix as usual
Fields
position: Vector3
the position component
scale: Vector3
the scale component
rotation: Quaternion
the rotation component
Implementations
impl Transform
[src]
pub fn up(self) -> Vector3
[src]
local up direction for transformation
pub fn forward(self) -> Vector3
[src]
local forward direction for transformation
pub fn right(self) -> Vector3
[src]
local right direction for transformation
pub fn move_by(&mut self, amount: impl Into<Vector3>)
[src]
move tranformation by specified amount
Note: this moves using global directions
pub fn move_up(&mut self, amount: f32)
[src]
move transformation up by specified amount
Note: this moves using local directions
pub fn move_down(&mut self, amount: f32)
[src]
move transformation down by specified amount
Note: this moves using local directions
pub fn move_right(&mut self, amount: f32)
[src]
move transformation right by specified amount
Note: this moves using local directions
pub fn move_left(&mut self, amount: f32)
[src]
move transformation left by specified amount
Note: this moves using local directions
pub fn move_forward(&mut self, amount: f32)
[src]
move transformation forward by specified amount
Note: this moves using local directions
pub fn move_back(&mut self, amount: f32)
[src]
move transformation back by specified amount
Note: this moves using local directions
pub fn move_around_point(
&mut self,
point: impl Into<Vector3>,
angle: f32,
axis: impl Into<Vector3>
)
[src]
&mut self,
point: impl Into<Vector3>,
angle: f32,
axis: impl Into<Vector3>
)
move transformation rotating it around some point around an axis
pub fn look_dir(&mut self, dir: impl Into<Vector3>)
[src]
rotates the transformation to look at specific direction
pub fn look_at(&mut self, pos: impl Into<Vector3>)
[src]
rotates the transformation to look at specific position
Trait Implementations
impl Clone for Transform
[src]
impl Copy for Transform
[src]
impl Debug for Transform
[src]
impl Default for Transform
[src]
impl From<Matrix4> for Transform
[src]
impl From<Transform> for Matrix4
[src]
impl PartialEq<Transform> for Transform
[src]
impl StructuralPartialEq for Transform
[src]
Auto Trait Implementations
impl RefUnwindSafe for Transform
impl Send for Transform
impl Sync for Transform
impl Unpin for Transform
impl UnwindSafe for Transform
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,