pub struct Vector4<S> {
pub x: S,
pub y: S,
pub z: S,
pub w: S,
}
Fields§
§x: S
§y: S
§z: S
§w: S
Implementations§
Trait Implementations§
source§impl<S: Copy> Array for Vector4<S>
impl<S: Copy> Array for Vector4<S>
type Element = S
source§fn min(self) -> Swhere
S: PartialOrd,
fn min(self) -> Swhere S: PartialOrd,
The minimum element of the array.
source§fn max(self) -> Swhere
S: PartialOrd,
fn max(self) -> Swhere S: PartialOrd,
The maximum element of the array.
source§fn as_mut_ptr(&mut self) -> *mut Self::Element
fn as_mut_ptr(&mut self) -> *mut Self::Element
Get a mutable pointer to the first element of the array.
source§fn swap_elements(&mut self, i: usize, j: usize)
fn swap_elements(&mut self, i: usize, j: usize)
Swap the elements at indices
i
and j
in-place.source§impl<S> AsMut<(S, S, S, S)> for Vector4<S>
impl<S> AsMut<(S, S, S, S)> for Vector4<S>
source§fn as_mut(&mut self) -> &mut (S, S, S, S)
fn as_mut(&mut self) -> &mut (S, S, S, S)
Converts this type into a mutable reference of the (usually inferred) input type.
source§impl<S> AsRef<(S, S, S, S)> for Vector4<S>
impl<S> AsRef<(S, S, S, S)> for Vector4<S>
source§fn as_ref(&self) -> &(S, S, S, S)
fn as_ref(&self) -> &(S, S, S, S)
Converts this type into a shared reference of the (usually inferred) input type.
source§impl<S: BaseFloat> EuclideanVector for Vector4<S>
impl<S: BaseFloat> EuclideanVector for Vector4<S>
source§fn angle(self, other: Vector4<S>) -> Rad<S>
fn angle(self, other: Vector4<S>) -> Rad<S>
The angle between the vector and
other
, in radians.source§fn is_perpendicular(self, other: Self) -> bool
fn is_perpendicular(self, other: Self) -> bool
Returns
true
if the vector is perpendicular (at right angles) to the
other vector.source§fn length2(self) -> Self::Scalar
fn length2(self) -> Self::Scalar
Returns the squared length of the vector. This does not perform an
expensive square root operation like in the
length
method and can
therefore be more efficient for comparing the lengths of two vectors.source§fn normalize(self) -> Self
fn normalize(self) -> Self
Returns a vector with the same direction, but with a
length
(or
norm
) of 1
.source§fn normalize_to(self, length: Self::Scalar) -> Self
fn normalize_to(self, length: Self::Scalar) -> Self
Returns a vector with the same direction and a given
length
.source§impl<'a, S> From<&'a (S, S, S, S)> for &'a Vector4<S>
impl<'a, S> From<&'a (S, S, S, S)> for &'a Vector4<S>
source§fn from(v: &'a (S, S, S, S)) -> &'a Vector4<S>
fn from(v: &'a (S, S, S, S)) -> &'a Vector4<S>
Converts to this type from the input type.
source§impl<'a, S> From<&'a mut (S, S, S, S)> for &'a mut Vector4<S>
impl<'a, S> From<&'a mut (S, S, S, S)> for &'a mut Vector4<S>
source§fn from(v: &'a mut (S, S, S, S)) -> &'a mut Vector4<S>
fn from(v: &'a mut (S, S, S, S)) -> &'a mut Vector4<S>
Converts to this type from the input type.
source§impl<S> From<(S, S, S, S)> for Vector4<S>
impl<S> From<(S, S, S, S)> for Vector4<S>
source§fn from(v: (S, S, S, S)) -> Vector4<S>
fn from(v: (S, S, S, S)) -> Vector4<S>
Converts to this type from the input type.
source§impl<S> Into<(S, S, S, S)> for Vector4<S>
impl<S> Into<(S, S, S, S)> for Vector4<S>
source§fn into(self) -> (S, S, S, S)
fn into(self) -> (S, S, S, S)
Converts this type into the (usually inferred) input type.
source§impl<S: PartialEq> PartialEq<Vector4<S>> for Vector4<S>
impl<S: PartialEq> PartialEq<Vector4<S>> for Vector4<S>
impl<S: Copy> Copy for Vector4<S>
impl<S: Eq> Eq for Vector4<S>
impl<S> StructuralEq for Vector4<S>
impl<S> StructuralPartialEq for Vector4<S>
Auto Trait Implementations§
impl<S> RefUnwindSafe for Vector4<S>where S: RefUnwindSafe,
impl<S> Send for Vector4<S>where S: Send,
impl<S> Sync for Vector4<S>where S: Sync,
impl<S> Unpin for Vector4<S>where S: Unpin,
impl<S> UnwindSafe for Vector4<S>where S: UnwindSafe,
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