pub struct EulerAngles(/* private fields */);Expand description
Euler angles are a representation of orientation in 3D space.
Implementations§
source§impl EulerAngles
impl EulerAngles
sourcepub fn new<A: Angle>(yaw: A, pitch: A, roll: A) -> Self
pub fn new<A: Angle>(yaw: A, pitch: A, roll: A) -> Self
Create a new Euler angle with the given yaw, pitch, and roll.
§Parameters
yaw- The yaw angle.pitch- The pitch angle.roll- The roll angle.
sourcepub const fn from_radians(yaw: Radian, pitch: Radian, roll: Radian) -> Self
pub const fn from_radians(yaw: Radian, pitch: Radian, roll: Radian) -> Self
Create a new Euler angle with the given yaw, pitch, and roll in radians.
§Parameters
yaw- The yaw angle in radians.pitch- The pitch angle in radians.roll- The roll angle in radians.
sourcepub fn from_pitch<A: Angle>(pitch: A) -> Self
pub fn from_pitch<A: Angle>(pitch: A) -> Self
source§impl EulerAngles
impl EulerAngles
source§impl EulerAngles
impl EulerAngles
Methods from Deref<Target = Vec3>§
sourcepub fn as_mut_slice(&mut self) -> &mut [f32]
pub fn as_mut_slice(&mut self) -> &mut [f32]
sourcepub fn as_mut_ptr(&mut self) -> *mut f32
pub fn as_mut_ptr(&mut self) -> *mut f32
Returns this vector as a mutable ptr of f32.
sourcepub fn iter_mut(&mut self) -> impl Iterator<Item = &mut f32>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut f32>
Returns a mutable iterator over the vector.
sourcepub fn x_mut(&mut self) -> &mut f32
pub fn x_mut(&mut self) -> &mut f32
Returns a mutable reference to the X-coordinate of this 3-component vector.
sourcepub fn y_mut(&mut self) -> &mut f32
pub fn y_mut(&mut self) -> &mut f32
Returns a mutable reference to the Y-coordinate of this 3-component vector.
sourcepub fn z_mut(&mut self) -> &mut f32
pub fn z_mut(&mut self) -> &mut f32
Returns a mutable reference to the Z-coordinate of this 3-component vector.
sourcepub fn xy_mut(&mut self) -> &mut Vec2
pub fn xy_mut(&mut self) -> &mut Vec2
Returns a mutable reference to the xy coordinates of this vector.
sourcepub fn yz_mut(&mut self) -> &mut Vec2
pub fn yz_mut(&mut self) -> &mut Vec2
Returns a mutable reference to the yz coordinates of this vector.
sourcepub fn square_magnitude(&self) -> f32
pub fn square_magnitude(&self) -> f32
Computes the square magnitude of this two-component vector.
sourcepub fn magnitude(&self) -> f32
pub fn magnitude(&self) -> f32
Computes the magnitude of this vector.
Where possible, consider using Vec3::square_magnitude as this will
avoid the need to compute the square-root.
sourcepub fn is_normalized(&self) -> bool
pub fn is_normalized(&self) -> bool
Queries whether this vector is normalized (e.g. has a magnitude of 1).
sourcepub fn normalized(&self) -> Vector3
pub fn normalized(&self) -> Vector3
Returns normalized vector.
sourcepub fn is_finite(&self) -> bool
pub fn is_finite(&self) -> bool
Returns whether all components of this Vec are finite.
§Example
Basic use:
let finite = Vector3::UNIT_X;
let not_finite = Vector3::new(f32::INFINITY, 3.0, 0.0);
assert!(finite.is_finite());
assert!(!not_finite.is_finite());sourcepub fn is_infinite(&self) -> bool
pub fn is_infinite(&self) -> bool
Trait Implementations§
source§impl Add for &EulerAngles
impl Add for &EulerAngles
source§impl Add for EulerAngles
impl Add for EulerAngles
source§impl AddAssign<&EulerAngles> for EulerAngles
impl AddAssign<&EulerAngles> for EulerAngles
source§fn add_assign(&mut self, rhs: &EulerAngles)
fn add_assign(&mut self, rhs: &EulerAngles)
+= operation. Read moresource§impl AddAssign for EulerAngles
impl AddAssign for EulerAngles
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+= operation. Read moresource§impl AsMut<Vec3> for EulerAngles
impl AsMut<Vec3> for EulerAngles
source§impl AsRef<Vec3> for EulerAngles
impl AsRef<Vec3> for EulerAngles
source§impl Borrow<Vec3> for EulerAngles
impl Borrow<Vec3> for EulerAngles
source§impl BorrowMut<Vec3> for EulerAngles
impl BorrowMut<Vec3> for EulerAngles
source§fn borrow_mut(&mut self) -> &mut Vec3
fn borrow_mut(&mut self) -> &mut Vec3
source§impl Clone for EulerAngles
impl Clone for EulerAngles
source§fn clone(&self) -> EulerAngles
fn clone(&self) -> EulerAngles
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for EulerAngles
impl Debug for EulerAngles
source§impl Default for EulerAngles
impl Default for EulerAngles
source§fn default() -> EulerAngles
fn default() -> EulerAngles
source§impl Deref for EulerAngles
impl Deref for EulerAngles
source§impl DerefMut for EulerAngles
impl DerefMut for EulerAngles
source§impl Div<f32> for &EulerAngles
impl Div<f32> for &EulerAngles
source§impl Div<f32> for EulerAngles
impl Div<f32> for EulerAngles
source§impl Mul<&EulerAngles> for f32
impl Mul<&EulerAngles> for f32
source§type Output = EulerAngles
type Output = EulerAngles
* operator.source§impl Mul<EulerAngles> for f32
impl Mul<EulerAngles> for f32
source§type Output = EulerAngles
type Output = EulerAngles
* operator.source§impl Mul<f32> for &EulerAngles
impl Mul<f32> for &EulerAngles
source§impl Mul<f32> for EulerAngles
impl Mul<f32> for EulerAngles
source§impl PartialEq for EulerAngles
impl PartialEq for EulerAngles
source§impl Sub for &EulerAngles
impl Sub for &EulerAngles
source§impl Sub for EulerAngles
impl Sub for EulerAngles
source§impl SubAssign<&EulerAngles> for EulerAngles
impl SubAssign<&EulerAngles> for EulerAngles
source§fn sub_assign(&mut self, rhs: &EulerAngles)
fn sub_assign(&mut self, rhs: &EulerAngles)
-= operation. Read moresource§impl SubAssign for EulerAngles
impl SubAssign for EulerAngles
source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
-= operation. Read moreimpl Copy for EulerAngles
impl StructuralPartialEq for EulerAngles
Auto Trait Implementations§
impl Freeze for EulerAngles
impl RefUnwindSafe for EulerAngles
impl Send for EulerAngles
impl Sync for EulerAngles
impl Unpin for EulerAngles
impl UnwindSafe for EulerAngles
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)