#[repr(C)]pub struct Vec4 {
pub x: f32,
pub y: f32,
pub z: f32,
pub w: f32,
}Fields§
§x: f32§y: f32§z: f32§w: f32Implementations§
Source§impl Vec4
impl Vec4
pub const ZERO: Vec4
pub const ONE: Vec4
pub const NEG_ONE: Vec4
pub const NAN: Vec4
pub const INFINITY: Vec4
pub const NEG_INFINITY: Vec4
pub const fn new(x: f32, y: f32, z: f32, w: f32) -> Vec4
pub const fn splat(value: f32) -> Vec4
pub const fn from_array(values: [f32; 4]) -> Vec4
pub const fn to_array(self) -> [f32; 4]
pub fn from_slice(values: &[f32]) -> Vec4
pub fn write_to_slice(self, values: &mut [f32])
pub fn is_finite(self) -> bool
pub fn is_nan(self) -> bool
pub fn dot(self, rhs: Vec4) -> f32
pub fn length_squared(self) -> f32
pub fn length_recip(self) -> f32
pub fn distance(self, other: Vec4) -> f32
pub fn distance_squared(self, other: Vec4) -> f32
Sourcepub fn try_normalize(self) -> Option<Vec4>
pub fn try_normalize(self) -> Option<Vec4>
Normalizes every finite nonzero vector, including subnormal inputs.
pub fn normalize(self) -> Vec4
pub fn normalize_or_zero(self) -> Vec4
pub fn normalize_or(self, fallback: Vec4) -> Vec4
pub fn is_normalized(self) -> bool
pub fn min(self, rhs: Vec4) -> Vec4
pub fn max(self, rhs: Vec4) -> Vec4
pub fn min_element(self) -> f32
pub fn max_element(self) -> f32
pub fn element_sum(self) -> f32
pub fn element_product(self) -> f32
pub fn abs(self) -> Vec4
pub fn signum(self) -> Vec4
pub fn floor(self) -> Vec4
pub fn ceil(self) -> Vec4
pub fn round(self) -> Vec4
pub fn trunc(self) -> Vec4
pub fn fract(self) -> Vec4
pub fn recip(self) -> Vec4
pub fn sqrt(self) -> Vec4
pub fn powf(self, exponent: f32) -> Vec4
pub fn exp(self) -> Vec4
pub fn clamp(self, min: Vec4, max: Vec4) -> Vec4
pub fn clamp_length(self, min: f32, max: f32) -> Vec4
pub fn clamp_length_max(self, max: f32) -> Vec4
pub fn clamp_length_min(self, min: f32) -> Vec4
pub fn lerp(self, rhs: Vec4, t: f32) -> Vec4
pub fn mul_add(self, multiplier: Vec4, add: Vec4) -> Vec4
pub fn abs_diff_eq(self, rhs: Vec4, tolerance: f32) -> bool
pub fn cmpeq(self, rhs: Vec4) -> BVec4
pub fn cmpne(self, rhs: Vec4) -> BVec4
pub fn cmplt(self, rhs: Vec4) -> BVec4
pub fn cmple(self, rhs: Vec4) -> BVec4
pub fn cmpgt(self, rhs: Vec4) -> BVec4
pub fn cmpge(self, rhs: Vec4) -> BVec4
pub fn select(mask: BVec4, if_true: Vec4, if_false: Vec4) -> Vec4
pub fn project_onto(self, other: Vec4) -> Vec4
pub fn reject_from(self, other: Vec4) -> Vec4
pub fn project_onto_normalized(self, normal: Vec4) -> Vec4
pub fn reject_from_normalized(self, normal: Vec4) -> Vec4
Sourcepub fn reflect(self, normal: Vec4) -> Vec4
pub fn reflect(self, normal: Vec4) -> Vec4
Reflects an incident vector about a unit surface normal.
pub fn move_towards(self, rhs: Vec4, max_distance: f32) -> Vec4
Source§impl Vec4
impl Vec4
pub const X: Vec4
pub const Y: Vec4
pub const Z: Vec4
pub const W: Vec4
pub const AXES: [Vec4; 4]
pub const fn truncate(self) -> Vec3
pub const fn xyz(self) -> Vec3
pub const fn xy(self) -> Vec2
pub const fn xz(self) -> Vec2
pub const fn zw(self) -> Vec2
pub const fn xyzw(self) -> Vec4
pub const fn wzyx(self) -> Vec4
Trait Implementations§
Source§impl AddAssign<f32> for Vec4
impl AddAssign<f32> for Vec4
Source§fn add_assign(&mut self, rhs: f32)
fn add_assign(&mut self, rhs: f32)
Performs the
+= operation. Read moreSource§impl AddAssign for Vec4
impl AddAssign for Vec4
Source§fn add_assign(&mut self, rhs: Vec4)
fn add_assign(&mut self, rhs: Vec4)
Performs the
+= operation. Read moreSource§impl DivAssign<f32> for Vec4
impl DivAssign<f32> for Vec4
Source§fn div_assign(&mut self, rhs: f32)
fn div_assign(&mut self, rhs: f32)
Performs the
/= operation. Read moreSource§impl DivAssign for Vec4
impl DivAssign for Vec4
Source§fn div_assign(&mut self, rhs: Vec4)
fn div_assign(&mut self, rhs: Vec4)
Performs the
/= operation. Read moreSource§impl MulAssign<f32> for Vec4
impl MulAssign<f32> for Vec4
Source§fn mul_assign(&mut self, rhs: f32)
fn mul_assign(&mut self, rhs: f32)
Performs the
*= operation. Read moreSource§impl MulAssign for Vec4
impl MulAssign for Vec4
Source§fn mul_assign(&mut self, rhs: Vec4)
fn mul_assign(&mut self, rhs: Vec4)
Performs the
*= operation. Read moreSource§impl SubAssign<f32> for Vec4
impl SubAssign<f32> for Vec4
Source§fn sub_assign(&mut self, rhs: f32)
fn sub_assign(&mut self, rhs: f32)
Performs the
-= operation. Read moreSource§impl SubAssign for Vec4
impl SubAssign for Vec4
Source§fn sub_assign(&mut self, rhs: Vec4)
fn sub_assign(&mut self, rhs: Vec4)
Performs the
-= operation. Read moreimpl Copy for Vec4
impl StructuralPartialEq for Vec4
impl Vec4Swizzles for Vec4
Auto Trait Implementations§
impl Freeze for Vec4
impl RefUnwindSafe for Vec4
impl Send for Vec4
impl Sync for Vec4
impl Unpin for Vec4
impl UnwindSafe for Vec4
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