Struct cxx_qt_lib::QVector4D
source · #[repr(C)]pub struct QVector4D { /* private fields */ }
Expand description
The QVector4D class represents a vector or vertex in 4D space.
Implementations§
source§impl QVector4D
impl QVector4D
sourcepub fn length_squared(&self) -> f32
pub fn length_squared(&self) -> f32
Returns the squared length of the vector from the origin. This is equivalent to the dot product of the vector with itself.
source§impl QVector4D
impl QVector4D
sourcepub fn normalized(&self) -> QVector4D
pub fn normalized(&self) -> QVector4D
Returns the normalized unit vector form of this vector.
If this vector is null, then a null vector is returned. If the length of the vector is very close to 1, then the vector will be returned as-is. Otherwise the normalized form of the vector of length 1 will be returned.
source§impl QVector4D
impl QVector4D
sourcepub fn to_vector_2d_affine(&self) -> QVector2D
pub fn to_vector_2d_affine(&self) -> QVector2D
Returns the 2D vector form of this 4D vector, dividing the x and y coordinates by the w coordinate and dropping the z coordinate. Returns a null vector if w is zero.
Trait Implementations§
source§impl ExternType for QVector4D
impl ExternType for QVector4D
source§impl PartialEq for QVector4D
impl PartialEq for QVector4D
impl StructuralPartialEq for QVector4D
Auto Trait Implementations§
impl Freeze for QVector4D
impl RefUnwindSafe for QVector4D
impl Send for QVector4D
impl Sync for QVector4D
impl Unpin for QVector4D
impl UnwindSafe for QVector4D
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