#[repr(C)]pub struct Vec4 {
pub x: f32,
pub y: f32,
pub z: f32,
pub w: f32,
}Expand description
Vector (as in linear algebra, not as in Vec!) with four elements.
Fields§
§x: f32§y: f32§z: f32§w: f32Implementations§
Source§impl Vec4
impl Vec4
pub const fn all(v: f32) -> Vec4
pub fn to_vec3(&self) -> Vec3
pub fn dot(&self, other: Vec4) -> f32
pub fn mix(a: Vec4, b: Vec4, f: f32) -> Vec4
pub fn is_equal_enough(&self, other: &Vec4) -> bool
pub fn from_hsva(hsv: Vec4) -> Vec4
pub fn to_hsva(&self) -> Vec4
pub fn from_u32(val: u32) -> Vec4
pub fn to_hex_string(&self) -> String
pub fn color(value: &str) -> Vec4
pub fn from_hex_bytes(bytes: &[u8]) -> Result<Vec4, ()>
pub fn clamp(&self, min: &Vec4, max: &Vec4) -> Vec4
pub fn as_array(&self) -> &[f32; 4]
pub fn as_mut_array(&mut self) -> &mut [f32; 4]
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
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