#[repr(C)]pub struct Vec4 {
pub x: f32,
pub y: f32,
pub z: f32,
pub w: f32,
}Expand description
A 4-dimensional vector with f32 components, often used for homogeneous coordinates.
In 3D graphics, Vec4 is primarily used to represent points (w=1.0) and
vectors (w=0.0) in homogeneous space, allowing them to be transformed by a Mat4.
Fields§
§x: f32The x component of the vector.
y: f32The y component of the vector.
z: f32The z component of the vector.
w: f32The w component, used for homogeneous coordinates.
Implementations§
Trait Implementations§
Source§impl<'__de, __Context> BorrowDecode<'__de, __Context> for Vec4
impl<'__de, __Context> BorrowDecode<'__de, __Context> for Vec4
Source§fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>(
decoder: &mut __D,
) -> Result<Self, DecodeError>
fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>( decoder: &mut __D, ) -> Result<Self, DecodeError>
Attempt to decode this type with the given BorrowDecode.
Source§impl<'de> Deserialize<'de> for Vec4
impl<'de> Deserialize<'de> for Vec4
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Vec4
impl Pod 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
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.