pub struct Vec3 {
pub x: f32,
pub y: f32,
pub z: f32,
}Expand description
A three-dimensional vector.
Fields§
§x: f32X component.
y: f32Y component.
z: f32Z component.
Implementations§
Source§impl Vec3
impl Vec3
Sourcepub fn length_squared(self) -> f32
pub fn length_squared(self) -> f32
Returns the squared length.
Sourcepub fn angle_between(self, rhs: Self) -> f32
pub fn angle_between(self, rhs: Self) -> f32
Returns the angle between vectors in radians.
Sourcepub fn mul_elements(self, rhs: Self) -> Self
pub fn mul_elements(self, rhs: Self) -> Self
Multiplies components pairwise.
Sourcepub fn div_elements(self, rhs: Self) -> Self
pub fn div_elements(self, rhs: Self) -> Self
Divides components pairwise. Zero divisors produce zero in that lane.
Trait Implementations§
Source§impl AddAssign for Vec3
impl AddAssign for Vec3
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreimpl Copy for Vec3
Source§impl DivAssign<f32> for Vec3
impl DivAssign<f32> for Vec3
Source§fn div_assign(&mut self, rhs: f32)
fn div_assign(&mut self, rhs: f32)
Performs the
/= operation. Read moreSource§impl MulAssign<f32> for Vec3
impl MulAssign<f32> for Vec3
Source§fn mul_assign(&mut self, rhs: f32)
fn mul_assign(&mut self, rhs: f32)
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