#[repr(C)]pub struct Vec3 {
pub x: f64,
pub y: f64,
pub z: f64,
}Expand description
A free 3-D vector with f64 components.
Distinct from crate::Point3: a Vec3 represents a direction + magnitude,
while a Point3 represents a location. The two types are deliberately
separated so the compiler catches confusion between them.
Fields§
§x: f64X component.
y: f64Y component.
z: f64Z component.
Implementations§
Trait Implementations§
Source§impl AddAssign for Vec3
impl AddAssign for Vec3
Source§fn add_assign(&mut self, r: Self)
fn add_assign(&mut self, r: Self)
Performs the
+= operation. Read moreSource§impl AddAssign<Vec3> for Point3
impl AddAssign<Vec3> for Point3
Source§fn add_assign(&mut self, v: Vec3)
fn add_assign(&mut self, v: Vec3)
Performs the
+= operation. Read moreimpl Copy for Vec3
Source§impl DivAssign<f64> for Vec3
impl DivAssign<f64> for Vec3
Source§fn div_assign(&mut self, s: f64)
fn div_assign(&mut self, s: f64)
Performs the
/= operation. Read moreSource§impl MulAssign<f64> for Vec3
impl MulAssign<f64> for Vec3
Source§fn mul_assign(&mut self, s: f64)
fn mul_assign(&mut self, s: f64)
Performs the
*= operation. Read moreimpl StructuralPartialEq for Vec3
Auto Trait Implementations§
impl Freeze for Vec3
impl RefUnwindSafe for Vec3
impl Send for Vec3
impl Sync for Vec3
impl Unpin for Vec3
impl UnsafeUnpin for Vec3
impl UnwindSafe for Vec3
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