pub struct Transform {
pub origin: [f64; 3],
pub rot: [[f64; 3]; 3],
}Expand description
Rotation followed by translation, in Source’s axis conventions
Fields§
§origin: [f64; 3]§rot: [[f64; 3]; 3]Columns are forward, left and up, like Source’s matrix3x4_t
Implementations§
Source§impl Transform
impl Transform
pub const IDENTITY: Self
Sourcepub fn from_entity(ent: &Entity) -> Self
pub fn from_entity(ent: &Entity) -> Self
Reads the entity’s origin and angles keys, missing ones count as zero
Sourcepub fn angles(&self, local: [f64; 3]) -> [f64; 3]
pub fn angles(&self, local: [f64; 3]) -> [f64; 3]
Maps entity angles (pitch yaw roll, in degrees) from local space to the parent space
Sourcepub fn apply_solid(&self, solid: &mut Solid)
pub fn apply_solid(&self, solid: &mut Solid)
Moves a brush: plane points, texture axes and displacement data
Sourcepub fn apply_entity(&self, ent: &mut Entity)
pub fn apply_entity(&self, ent: &mut Entity)
Moves an entity’s origin, turns its angles and moves its brushes.
Other keys that only the FGD knows to be positions or angles (movedir, the pitch of lights) stay as they are
Trait Implementations§
impl Copy for Transform
Source§impl Mul for Transform
parent * child maps points from the child’s local space straight to the parent’s parent space
impl Mul for Transform
parent * child maps points from the child’s local space straight to the parent’s parent space
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 UnsafeUnpin 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