pub struct Vec3 {
pub x: f64,
pub y: f64,
pub z: f64,
}Fields§
§x: f64§y: f64§z: f64Implementations§
Source§impl Vec3
impl Vec3
pub const ZERO: Vec3
pub const X: Vec3
pub const Y: Vec3
pub const Z: Vec3
pub const fn new(x: f64, y: f64, z: f64) -> Vec3
pub fn from_array(a: [f64; 3]) -> Vec3
pub fn to_array(self) -> [f64; 3]
pub fn dot(self, o: Vec3) -> f64
pub fn cross(self, o: Vec3) -> Vec3
pub fn norm2(self) -> f64
pub fn norm(self) -> f64
Sourcepub fn unit(self) -> Option<Vec3>
pub fn unit(self) -> Option<Vec3>
The unit vector along self, or None when it is too short to have a direction.
Sourcepub fn unit_or_zero(self) -> Vec3
pub fn unit_or_zero(self) -> Vec3
The unit vector along self, or the zero vector.
pub fn lerp(self, o: Vec3, t: f64) -> Vec3
pub fn dist(self, o: Vec3) -> f64
Sourcepub fn any_perpendicular(self) -> Vec3
pub fn any_perpendicular(self) -> Vec3
Some unit vector perpendicular to self.
pub fn max_abs(self) -> f64
pub fn is_finite(self) -> bool
Trait Implementations§
Source§impl AddAssign for Vec3
impl AddAssign for Vec3
Source§fn add_assign(&mut self, o: Vec3)
fn add_assign(&mut self, o: Vec3)
Performs the
+= operation. Read moreimpl Copy for Vec3
impl StructuralPartialEq for Vec3
Auto Trait Implementations§
impl Forget for Vec3
impl Freeze for Vec3
impl Move 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