pub struct Transform {
pub position: Vec3,
pub rotation: Vec3,
pub scale: Vec3,
pub rotation_quat: Option<[f32; 4]>,
}Expand description
A 3D transform with position, rotation (Euler angles), and scale
Fields§
§position: Vec3§rotation: Vec3Rotation in degrees (Euler angles: pitch, yaw, roll)
scale: Vec3§rotation_quat: Option<[f32; 4]>Optional quaternion rotation [x, y, z, w]. When present, takes precedence over Euler angles in to_matrix() to avoid gimbal lock.
Implementations§
Source§impl Transform
impl Transform
pub const IDENTITY: Self
pub fn from_position(position: Vec3) -> Self
pub fn with_position(self, position: Vec3) -> Self
pub fn with_rotation(self, rotation: Vec3) -> Self
pub fn with_scale(self, scale: Vec3) -> Self
pub fn with_rotation_quat(self, q: [f32; 4]) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Transform
impl<'de> Deserialize<'de> for Transform
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 Transform
impl StructuralPartialEq for Transform
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