pub struct Rotator {
pub pitch: f32,
pub yaw: f32,
pub roll: f32,
}Expand description
Unreal Engine style Rotator (Pitch, Yaw, Roll in degrees)
Represents rotation using Euler angles in degrees:
- Pitch: Rotation around Y axis (up/down)
- Yaw: Rotation around Z axis (left/right)
- Roll: Rotation around X axis (banking)
Fields§
§pitch: f32Rotation around Y axis (degrees)
yaw: f32Rotation around Z axis (degrees)
roll: f32Rotation around X axis (degrees)
Implementations§
Source§impl Rotator
impl Rotator
Sourcepub fn new(pitch: f32, yaw: f32, roll: f32) -> Self
pub fn new(pitch: f32, yaw: f32, roll: f32) -> Self
Create a new rotator with the given pitch, yaw, and roll (in degrees)
Sourcepub fn from_pitch(pitch: f32) -> Self
pub fn from_pitch(pitch: f32) -> Self
Create a rotator with only pitch rotation
Sourcepub fn to_quaternion(self) -> Quaternion
pub fn to_quaternion(self) -> Quaternion
Convert to quaternion (preferred for math operations)
Sourcepub fn from_quaternion(quat: Quaternion) -> Self
pub fn from_quaternion(quat: Quaternion) -> Self
Create from quaternion
Sourcepub fn get_forward_vector(self) -> Vector
pub fn get_forward_vector(self) -> Vector
Get the forward vector for this rotation
Sourcepub fn get_right_vector(self) -> Vector
pub fn get_right_vector(self) -> Vector
Get the right vector for this rotation
Sourcepub fn get_up_vector(self) -> Vector
pub fn get_up_vector(self) -> Vector
Get the up vector for this rotation
Sourcepub fn is_nearly_zero(self, tolerance: f32) -> bool
pub fn is_nearly_zero(self, tolerance: f32) -> bool
Check if this rotator is nearly zero
Sourcepub fn is_nearly_equal(self, other: Rotator, tolerance: f32) -> bool
pub fn is_nearly_equal(self, other: Rotator, tolerance: f32) -> bool
Check if two rotators are nearly equal
Trait Implementations§
Source§impl BinarySerializable for Rotator
impl BinarySerializable for Rotator
Source§impl<'de> Deserialize<'de> for Rotator
impl<'de> Deserialize<'de> for Rotator
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Rotator
impl StructuralPartialEq for Rotator
Auto Trait Implementations§
impl Freeze for Rotator
impl RefUnwindSafe for Rotator
impl Send for Rotator
impl Sync for Rotator
impl Unpin for Rotator
impl UnwindSafe for Rotator
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